diff options
author | Eddie Arrage <eddie.arrage@huawei.com> | 2018-06-22 21:25:54 +0000 |
---|---|---|
committer | Eddie Arrage <eddie.arrage@huawei.com> | 2018-08-28 17:23:09 +0000 |
commit | afc4beed0f62ea26b155e0ac6f7b1f84e10bd38b (patch) | |
tree | b0dbe1a6c8b750c5b6bd5b9f392ec3189f38a7f7 /samples/services/nginx/docker/subservices | |
parent | 1f543c55dd426a34ab3cafa514fa446c22b6fa03 (diff) |
Add file upload/download and configure URL paths
- Compile nginx from source in order to employ additional modules
- Add nginx-upload-module for high performance file upload that
avoids the need for file copies with a web application.
- File upload allows for placement of files for file download
for performance benchmarking.
- File upload can also be used directly for bi-directional throughput
testing having emulated clients upload files while file downloads
simultaneously occur.
- Nginx file upload stores files with hash to avoid conflicting
file names. Upload block in nginx config is configured to send
REST message to clover-controller with file metadata (original
filename, size, etc.) clover-controller will be responsible for
modifying the hashed filename and placing in a target directory
within an nginx server.
- Build also adds nginx-rtmp module to act as streaming media server
L7 loader will be extended to fetch streaming files from RTMP
servers.
- Add ability to create directories in server site root
and create the location directive(s) in nginx configuration
- Separated upload for configuration (download
files in various paths) from upload for testing (upload
to create bi-directional session throughput)
- Upload for testing does not sent upload metadata to
clover-controller
- Added ability to move upload files to file folders in the nginx site
root to use for download
- Delete files in upload folder
- Fixed issue with 426 Upgrade Required error message
when upload module sends upload metadata to clover-controller
- Added server name to metadata sent to clover-controller
Change-Id: Ib4cf6240f92360b82f378c062675f4fdaa19ca93
Signed-off-by: Eddie Arrage <eddie.arrage@huawei.com>
Diffstat (limited to 'samples/services/nginx/docker/subservices')
-rw-r--r-- | samples/services/nginx/docker/subservices/server/Dockerfile | 102 |
1 files changed, 97 insertions, 5 deletions
diff --git a/samples/services/nginx/docker/subservices/server/Dockerfile b/samples/services/nginx/docker/subservices/server/Dockerfile index 434a8d4..1ab0481 100644 --- a/samples/services/nginx/docker/subservices/server/Dockerfile +++ b/samples/services/nginx/docker/subservices/server/Dockerfile @@ -15,14 +15,106 @@ RUN \ wget \ libdnet \ net-tools \ -# Nginx as proxy - nginx \ +# Packages required to build nginx from source + build-essential \ + libpcre3-dev \ + libpcre3++-dev \ + libgeoip-dev \ + libxslt-dev \ + git \ +# Install required python packages python-pip \ && \ -# Install required python packages - python -m pip install grpcio redis jinja2 protobuf + python -m pip install grpcio redis jinja2 protobuf psutil \ +&& \ +# Get nginx and module add-on source + wget https://nginx.org/download/nginx-1.15.0.tar.gz && tar zxvf nginx-1.15.0.tar.gz \ +&& \ + wget https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.gz && tar xzvf pcre-8.42.tar.gz \ +&& \ + wget http://www.zlib.net/zlib-1.2.11.tar.gz && tar xzvf zlib-1.2.11.tar.gz \ +&& \ + wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz && tar xzvf openssl-1.1.0f.tar.gz \ +&& \ + git clone https://github.com/Austinb/nginx-upload-module.git \ +&& \ + wget https://github.com/arut/nginx-rtmp-module/archive/v1.2.1.tar.gz && tar xzvf v1.2.1.tar.gz +RUN rm -rf *.tar.gz + +# Build supporting modules +ENV LDFLAGS -fPIC +WORKDIR /pcre-8.42 +RUN ./configure +RUN make +RUN make install + +WORKDIR /zlib-1.2.11 +RUN ./configure +RUN make +RUN make install + +WORKDIR /openssl-1.1.0f +RUN ./config +RUN make +RUN make install + +WORKDIR /nginx-1.15.0 + +# Build nginx with all modules in stock Ubuntu 16.04 version +# Add upload and rtmp modules +RUN ./configure \ + --prefix=/usr/share/nginx \ + --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ + --http-scgi-temp-path=/var/lib/nginx/scgi \ + --sbin-path=/usr/sbin/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/run/nginx.pid \ + --lock-path=/var/lock/nginx.lock \ + --with-pcre=../pcre-8.42 \ + --with-pcre-jit \ + --with-ipv6 \ + --with-http_stub_status_module \ + # --with-http_image_filter_module \ + --with-http_xslt_module \ + --with-mail \ + --with-zlib=../zlib-1.2.11 \ + --with-openssl=../openssl-1.1.0f \ + --with-openssl-opt=enable-ec_nistp_64_gcc_128 \ + --with-openssl-opt=no-nextprotoneg \ + --with-openssl-opt=no-weak-ssl-ciphers \ + --with-openssl-opt=no-ssl3 \ + --with-http_ssl_module \ + --with-stream \ + --with-stream_ssl_module \ + --with-threads \ + --with-mail=dynamic \ + --with-mail_ssl_module \ + --http-client-body-temp-path=/var/lib/nginx/body \ + --http-proxy-temp-path=/var/lib/nginx/proxy \ + --with-http_realip_module \ + --with-http_geoip_module \ + --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ + --with-http_v2_module \ + --with-http_sub_module \ + --with-http_addition_module \ + --with-http_dav_module \ + --with-http_auth_request_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-debug \ + --add-module=../nginx-upload-module \ + --add-module=../nginx-rtmp-module-1.2.1 + +RUN make +RUN make install + +WORKDIR / +RUN mkdir /var/lib/nginx +RUN mkdir /var/www +RUN mkdir /var/www/html COPY /process /process COPY /grpc /grpc CMD ./process/start_process.sh server - |