diff --git a/backend.Dockerfile b/backend.Dockerfile index 67f310d0f970228bd93773b64cfe317b99c924cb..cb9e5445c357c202b8ed583aea26803ba3a33072 100644 --- a/backend.Dockerfile +++ b/backend.Dockerfile @@ -20,7 +20,7 @@ # The dockerfile is multistages to getaway with building on a larger base image. # using the base image with most requirements already installed -FROM nomadxt_requirements:latest as requirements +FROM nomad_requirements:latest as requirements # we use slim for the final image FROM python:3.6-slim as final diff --git a/docs/setup.md b/docs/setup.md index abd8d00ecee2538b82bcbbaecb86c6ff8d06f5a0..f16ed43da03c34e9be399f07d09d77d9c4185db7 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -109,9 +109,9 @@ reinstall them all the time, we need to build new images. The fontend image is only for building and serving the gui. -Build the requirements image tagged `nomadxt_requirements`: +Build the requirements image tagged `nomad_requirements`: ``` -docker build -t nomadxt_requirements -f requirements.Dockerfile . +docker build -t nomad_requirements -f requirements.Dockerfile . ``` The other images are build via *docker-compose* and don't have to be created manually. @@ -121,7 +121,7 @@ The other images are build via *docker-compose* and don't have to be created man Now we can build the *docker-compose* that contains all external services (rabbitmq, mongo, elastic, minio, elk) and nomad services (worker, handler, api, gui). ``` -cd ./infrastructure/nomadxt +cd ./infrastructure/nomad docker-compose build ``` @@ -167,7 +167,7 @@ docker-compose up api gui proxy Usually these services only used by the nomad containers, but sometimes you also need to checkseomthing or do some manual steps. -The file `infrastructure/nomadxt/.env` contains variables that control the ports +The file `infrastructure/nomad/.env` contains variables that control the ports used to bind internal docker ports to your host machine. These are the ports you have to use to connect to the respective services. diff --git a/frontend.Dockerfile b/frontend.Dockerfile index 32c259b0e0396925717ab933667e7ecdac75fc47..396189c5dbe364dd89383d5637423da5ba152539 100644 --- a/frontend.Dockerfile +++ b/frontend.Dockerfile @@ -13,5 +13,5 @@ RUN yarn build # production environment FROM nginx:1.13.9-alpine -COPY --from=builder /nomad/app/build /app/nomadxt +COPY --from=builder /nomad/app/build /app/nomad CMD ["nginx", "-g", "daemon off;"] diff --git a/gui/.env.development b/gui/.env.development index 6b6fea039f6c5dcaf63f25375aa4ac5edce77000..f636c30c63ecd377840aa33efddca56c19af059e 100644 --- a/gui/.env.development +++ b/gui/.env.development @@ -1,5 +1,5 @@ -REACT_APP_API_BASE = 'http://localhost:8000/nomadxt/api' +REACT_APP_API_BASE = 'http://localhost:8000/nomad/api' REACT_APP_OBJECT_BASE = 'http://localhost:9007' -REACT_APP_APP_BASE = '/nomadxt' +REACT_APP_APP_BASE = '/nomad' REACT_APP_APP_STATIC_BASE = '' REACT_APP_DEBUG = 'true' \ No newline at end of file diff --git a/gui/.env.production b/gui/.env.production index ae3eb4a179f93a949467888f1dcec7a17a8a5eda..7755d9dcad9e47d2023b15e0c718a9f41f268ae2 100644 --- a/gui/.env.production +++ b/gui/.env.production @@ -1,5 +1,5 @@ -REACT_APP_API_BASE = '/nomadxt/api' -REACT_APP_OBJECT_BASE = '/nomadxt/objects' -REACT_APP_APP_BASE = '/nomadxt' -REACT_APP_APP_STATIC_BASE = '/nomadxt' +REACT_APP_API_BASE = '/nomad/api' +REACT_APP_OBJECT_BASE = '/nomad/objects' +REACT_APP_APP_BASE = '/nomad' +REACT_APP_APP_STATIC_BASE = '/nomad' REACT_APP_DEBUG = 'true' \ No newline at end of file diff --git a/gui/package.json b/gui/package.json index a2e8de99d6a6f78139e650b5c06f5e761317e0f6..8ce96ad07c9b73488348c4d2ef922c1d49bab1cc 100644 --- a/gui/package.json +++ b/gui/package.json @@ -40,5 +40,5 @@ "eslint-plugin-standard": "^3.1.0", "serve": "^10.0.0" }, - "homepage": "http://mywebsite.com/nomadxt" + "homepage": "http://mywebsite.com/nomad" } diff --git a/gui/src/components/Development.js b/gui/src/components/Development.js index 6b4bfe71d4c49cf680c39fc86577cc93f1b90c23..f1fadf5c3ef996d38b3f24c7e0134a25d0a177eb 100644 --- a/gui/src/components/Development.js +++ b/gui/src/components/Development.js @@ -30,7 +30,7 @@ class Development extends React.Component { This system pushes logs, events, monitoring data, and other application metrics to a central database where it can be analysed visually. - \n\n[Link to Kiaba](/nomadxt/kibana/) + \n\n[Link to Kiaba](/nomad/kibana/) `}</Markdown> </div> ) diff --git a/infrastructure/elk/README.md b/infrastructure/elk/README.md index 5522c984257089e18dfba4aa86fb419b6922c711..5ff052bf2d3e81d2eb8641144f98c53a65938e98 100644 --- a/infrastructure/elk/README.md +++ b/infrastructure/elk/README.md @@ -8,7 +8,7 @@ This image is based on the populer elk-stack docker image: - disabled ssl for beats communication to logstash server - added tcp input - simplified elastic search output (don't now how to set metric and other vars yet :-() -- added kibana.yml::server.basePath="/nomadxt/kibana" +- added kibana.yml::server.basePath="/nomad/kibana" ## Usage @@ -17,7 +17,7 @@ You can run this image outside the usual docker-compose. To use this image with reverse proxy in nginx, use: ``` -location ~ ^/nomadxt/kibana/(.*)$ { +location ~ ^/nomad/kibana/(.*)$ { proxy_pass http://130.183.207.116:15601/$1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/infrastructure/elk/kibana.yml b/infrastructure/elk/kibana.yml index bfc60a0af604b093fac68f064d69a5ee2b9c89d6..957b5692196fca11cc38e0a88b29cef2a62e0f02 100644 --- a/infrastructure/elk/kibana.yml +++ b/infrastructure/elk/kibana.yml @@ -11,7 +11,7 @@ server.host: "0.0.0.0" # Enables you to specify a path to mount Kibana at if you are running behind a proxy. This only affects # the URLs generated by Kibana, your proxy is expected to remove the basePath value before forwarding requests # to Kibana. This setting cannot end in a slash. -server.basePath: "/nomadxt/kibana" +server.basePath: "/nomad/kibana" # The maximum payload size in bytes for incoming server requests. #server.maxPayloadBytes: 1048576 diff --git a/infrastructure/elk/run_elk.sh b/infrastructure/elk/run_elk.sh index 56ca95e54ab77bd999988ab18d4a5cad2112b7e2..6484dbb16525e5e1192dae15c90a39adac1e58b3 100644 --- a/infrastructure/elk/run_elk.sh +++ b/infrastructure/elk/run_elk.sh @@ -1,3 +1,3 @@ #!/bin/bash -docker build -t nomadxt_elk . -docker run -v nomadxt_elk:/var/lib/elasticsearch -p 15601:5601 -p 15000:5000 -p 15044:5044 --restart=always nomadxt_elk \ No newline at end of file +docker build -t nomad_elk . +docker run -v nomad_elk:/var/lib/elasticsearch -p 15601:5601 -p 15000:5000 -p 15044:5044 --restart=always nomad_elk \ No newline at end of file diff --git a/infrastructure/nomadxt/.env_processing b/infrastructure/nomadxt/.env_processing index c7a9f86ed96bd93106bc8fa15625dddd75dabfd4..54aba99d3a9d51848d16c8384eebddb00dca342a 100644 --- a/infrastructure/nomadxt/.env_processing +++ b/infrastructure/nomadxt/.env_processing @@ -9,6 +9,6 @@ API_HOST_PORT=18000 GUI_HOST_PORT=18080 APP_HOST_PORT=0.0.0.0:10080 -VOLUME_BINDS=/scratch/nomadxt +VOLUME_BINDS=/scratch/nomad_FAIR EXTERNAL_HOST=enc-staging-nomad.esc.rzg.mpg.de EXTERNAL_PORT=80 diff --git a/infrastructure/nomadxt/docker-compose.yml b/infrastructure/nomadxt/docker-compose.yml index b308ca3384a6c21cd8c6a17086f0540175e47e1e..f2b9d940c8c22b891069e2174371ce7dd5d694bd 100644 --- a/infrastructure/nomadxt/docker-compose.yml +++ b/infrastructure/nomadxt/docker-compose.yml @@ -20,7 +20,7 @@ services: restart: always image: minio/minio:RELEASE.2018-06-08T03-49-38Z # image: minio/minio - container_name: nomadxt_minio + container_name: nomad_minio ports: - ${MINIO_HOST_PORT}:9000 volumes: @@ -48,7 +48,7 @@ services: rabbitmq: restart: always image: rabbitmq - container_name: nomadxt_rabbitmq + container_name: nomad_rabbitmq environment: - RABBITMQ_ERLANG_COOKIE=SWQOKODSQALRPCLNMEQG - RABBITMQ_DEFAULT_USER=rabbitmq @@ -57,26 +57,26 @@ services: ports: - ${RABBITMQ_HOST_PORT}:5672 volumes: - - nomadxt_rabbitmq:/var/lib/rabbitmq + - nomad_rabbitmq:/var/lib/rabbitmq # the search engine elastic: image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2 - container_name: nomadxt_elastic + container_name: nomad_elastic volumes: - - nomadxt_elastic:/usr/share/elasticsearch/data + - nomad_elastic:/usr/share/elasticsearch/data ports: - ${ELASTIC_HOST_PORT}:9200 # the user data db mongo: image: mongo:latest - container_name: nomadxt_mongo + container_name: nomad_mongo environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null volumes: - - nomadxt_mongo:/data/db + - nomad_mongo:/data/db ports: - ${MONGO_HOST_PORT}:27017 command: mongod --smallfiles --logpath=/dev/null # --quiet @@ -85,12 +85,12 @@ services: elk: restart: always build: ../elk/ - container_name: nomadxt_elk + container_name: nomad_elk expose: - 5000 # logstash beats - 5044 # logstash tcp volumes: - - nomadxt_elk:/var/lib/elasticsearch + - nomad_elk:/var/lib/elasticsearch ports: - ${KIBANA_HOST_PORT}:5601 # kibana web @@ -100,7 +100,7 @@ services: build: context: ../../ dockerfile: backend.Dockerfile - container_name: nomadxt_worker + container_name: nomad_worker environment: - NOMAD_MINIO_PORT=9000 - NOMAD_MINIO_HOST=minio @@ -108,7 +108,7 @@ services: - NOMAD_LOGSTASH_HOST=elk - NOMAD_ELASTIC_HOST=elastic - NOMAD_MONGO_HOST=mongo - - NOMAD_SERVICE=nomadxt_worker + - NOMAD_SERVICE=nomad_worker links: - minio - rabbitmq @@ -125,7 +125,7 @@ services: build: context: ../../ dockerfile: backend.Dockerfile - container_name: nomadxt_handler + container_name: nomad_handler environment: - NOMAD_MINIO_PORT=9000 - NOMAD_MINIO_HOST=minio @@ -133,7 +133,7 @@ services: - NOMAD_LOGSTASH_HOST=elk - NOMAD_MONGO_HOST=mongo - NOMAD_ELASTIC_HOST=elastic - - NOMAD_SERVICE=nomadxt_handler + - NOMAD_SERVICE=nomad_handler links: - minio - rabbitmq @@ -148,7 +148,7 @@ services: build: context: ../../ dockerfile: backend.Dockerfile - container_name: nomadxt_api + container_name: nomad_api environment: - NOMAD_MINIO_PORT=9000 - NOMAD_MINIO_HOST=minio @@ -156,11 +156,11 @@ services: - NOMAD_LOGSTASH_HOST=elk - NOMAD_ELASTIC_HOST=elastic - NOMAD_MONGO_HOST=mongo - - NOMAD_API_BASE_PATH=/nomadxt/api + - NOMAD_API_BASE_PATH=/nomad/api - NOMAD_OBJECTS_HOST=${EXTERNAL_HOST} - NOMAD_OBJECTS_PORT=${EXTERNAL_PORT} - - NOMAD_OBJECTS_BASE_PATH=/nomadxt/objects - - NOMAD_SERVICE=nomadxt_api + - NOMAD_OBJECTS_BASE_PATH=/nomad/objects + - NOMAD_SERVICE=nomad_api links: - minio - rabbitmq @@ -176,7 +176,7 @@ services: build: context: ../../ dockerfile: frontend.Dockerfile - container_name: nomadxt_gui + container_name: nomad_gui ports: - ${GUI_HOST_PORT}:8080 volumes: @@ -187,7 +187,7 @@ services: proxy: restart: always image: nginx:1.13.9-alpine - container_name: nomadxt_proxy + container_name: nomad_proxy links: - elk - gui @@ -200,11 +200,11 @@ services: command: nginx -g 'daemon off;' volumes: - nomadxt_minio: - nomadxt_mongo: - nomadxt_elastic: - nomadxt_redis: - nomadxt_rabbitmq: - nomadxt_elk: + nomad_minio: + nomad_mongo: + nomad_elastic: + nomad_redis: + nomad_rabbitmq: + nomad_elk: diff --git a/infrastructure/nomadxt/gui.conf b/infrastructure/nomadxt/gui.conf index 819d453d716b878cb9077c3e94e511641799c65d..51064407ee378b641feecfce3a56e1a39490dd4c 100644 --- a/infrastructure/nomadxt/gui.conf +++ b/infrastructure/nomadxt/gui.conf @@ -2,8 +2,8 @@ server { listen 8080; server_name www.example.com; - location /nomadxt { + location /nomad { root /app/; - try_files $uri /nomadxt/index.html; # fall back to index.html to support routing + try_files $uri /nomad/index.html; # fall back to index.html to support routing } } diff --git a/infrastructure/nomadxt/nginx.conf b/infrastructure/nomadxt/nginx.conf index 86defed4dfe19b642464be88033b32b7ff184ad8..edfc38fbc7bad21614c8767c1c0e40814b08f886 100644 --- a/infrastructure/nomadxt/nginx.conf +++ b/infrastructure/nomadxt/nginx.conf @@ -2,19 +2,19 @@ server { listen 80; server_name www.example.com; - location /nomadxt { + location /nomad { proxy_pass http://gui:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } - location /nomadxt/api { + location /nomad/api { proxy_set_header Host $host; proxy_pass_request_headers on; proxy_pass http://api:8000; } - location ~ ^/nomadxt/objects/(.*)$ { + location ~ ^/nomad/objects/(.*)$ { client_max_body_size 20g; resolver 127.0.0.11 ipv6=off; # docker embedded DNS proxy_set_header Host $host; @@ -22,7 +22,7 @@ server { proxy_set_header X-Real-IP $remote_addr; } - location ~ ^/nomadxt/kibana/(.*)$ { + location ~ ^/nomad/kibana/(.*)$ { resolver 127.0.0.11 ipv6=off; # docker embedded DNS proxy_pass http://elk:5601/$1$is_args$args; # fix: https://github.com/elastic/kibana/issues/13533 proxy_set_header Host $host; diff --git a/infrastructure/utils.http b/infrastructure/utils.http index 1fc1c6a807b10b1e5cbce8117f6f3040c734960a..09d4db039947a56f947b7a9a1c586eca87d5eec6 100644 --- a/infrastructure/utils.http +++ b/infrastructure/utils.http @@ -43,9 +43,9 @@ content-type: application/json } ### -POST http://localhost:8000/nomadxt/api/admin/repair_uploads HTTP/1.1 +POST http://localhost:8000/nomad/api/admin/repair_uploads HTTP/1.1 ### -GET http://enc-staging-nomad.esc.rzg.mpg.de//nomadxt/api/uploads HTTP/1.1 +GET http://enc-staging-nomad.esc.rzg.mpg.de//nomad/api/uploads HTTP/1.1 Authorization: Basic bWVAZ21haWwuY29tOm5vbWFk diff --git a/nomad/api.py b/nomad/api.py index e7d96d1d0fa65cf2ff694dd59f36abb9258b412f..782c0a5a7fdd3f5d40294731dd45291268451ea3 100644 --- a/nomad/api.py +++ b/nomad/api.py @@ -87,7 +87,7 @@ class UploadsRes(Resource): .. sourcecode:: http - GET /nomadxt/api/uploads HTTP/1.1 + GET /nomad/api/uploads HTTP/1.1 Accept: application/json **Example response**: @@ -134,7 +134,7 @@ class UploadsRes(Resource): .. sourcecode:: http - POST /nomadxt/api/uploads HTTP/1.1 + POST /nomad/api/uploads HTTP/1.1 Accept: application/json Content-Type: application/json @@ -206,7 +206,7 @@ class UploadRes(Resource): .. sourcecode:: http - GET /nomadxt/api/uploads/5b89469e0d80d40008077dbc HTTP/1.1 + GET /nomad/api/uploads/5b89469e0d80d40008077dbc HTTP/1.1 Accept: application/json **Example response**: @@ -310,7 +310,7 @@ class UploadRes(Resource): .. sourcecode:: http - POST /nomadxt/api/uploads HTTP/1.1 + POST /nomad/api/uploads HTTP/1.1 Accept: application/json Content-Type: application/json @@ -357,7 +357,7 @@ class UploadRes(Resource): .. sourcecode:: http - DELETE /nomadxt/api/uploads/5b89469e0d80d40008077dbc HTTP/1.1 + DELETE /nomad/api/uploads/5b89469e0d80d40008077dbc HTTP/1.1 Accept: application/json :param string upload_id: the id for the upload @@ -396,7 +396,7 @@ class RepoCalcRes(Resource): .. sourcecode:: http - GET /nomadxt/api/repo/W36aqCzAKxOCfIiMFsBJh3nHPb4a/7ddvtfRfZAvc3Crr7jOJ8UH0T34I HTTP/1.1 + GET /nomad/api/repo/W36aqCzAKxOCfIiMFsBJh3nHPb4a/7ddvtfRfZAvc3Crr7jOJ8UH0T34I HTTP/1.1 Accept: application/json **Example response**: @@ -457,7 +457,7 @@ class RepoCalcsRes(Resource): .. sourcecode:: http - GET /nomadxt/api/repo?page=1&per_page=25 HTTP/1.1 + GET /nomad/api/repo?page=1&per_page=25 HTTP/1.1 Accept: application/json **Example response**: @@ -558,7 +558,7 @@ def get_calc(upload_hash, calc_hash): .. sourcecode:: http - GET /nomadxt/api/archive/W36aqCzAKxOCfIiMFsBJh3nHPb4a/7ddvtfRfZAvc3Crr7jOJ8UH0T34I HTTP/1.1 + GET /nomad/api/archive/W36aqCzAKxOCfIiMFsBJh3nHPb4a/7ddvtfRfZAvc3Crr7jOJ8UH0T34I HTTP/1.1 Accept: application/json :param string upload_hash: the hash of the upload (from uploaded file contents) diff --git a/nomad/client.py b/nomad/client.py index 4888b8701e9c364442133aaa60c7f7726985cac1..9da2182003276f2eb58293e448a53dca6fd96191 100644 --- a/nomad/client.py +++ b/nomad/client.py @@ -24,7 +24,7 @@ import sys import requests from requests.auth import HTTPBasicAuth -api_base = 'http://localhost/nomadxt/api' +api_base = 'http://localhost/nomad/api' def upload_file(file_path, name=None, user='other@gmail.com', pw='nomad'): diff --git a/nomad/config.py b/nomad/config.py index 469c6e984614246eca623bee947e27aa213c3c00..ae864cb7016945e5cc75cb5a1d3f5e53402654f7 100644 --- a/nomad/config.py +++ b/nomad/config.py @@ -91,7 +91,7 @@ logstash = LogstashConfig( level=int(os.environ.get('NOMAD_LOGSTASH_LEVEL', logging.DEBUG)) ) services = NomadServicesConfig( - api_base_path=os.environ.get('NOMAD_API_BASE_PATH', '/nomadxt/api'), + api_base_path=os.environ.get('NOMAD_API_BASE_PATH', '/nomad/api'), objects_host=os.environ.get('NOMAD_OBJECTS_HOST', 'localhost'), objects_port=int(os.environ.get('NOMAD_OBJECTS_PORT', minio.port)), objects_base_path=os.environ.get('NOMAD_OBJECTS_BASE_PATH', ''), diff --git a/tests/misc.http b/tests/misc.http index e5b29435db5ae6908c4bc28f691aaaba48ff8bdc..7b4546f45b8aa49f81fe7019994197445e701cd8 100644 --- a/tests/misc.http +++ b/tests/misc.http @@ -1,8 +1,8 @@ -GET http://localhost/nomadxt/api/uploads HTTP/1.1 +GET http://localhost/nomad/api/uploads HTTP/1.1 ### -POST http://localhost/nomadxt/api/uploads HTTP/1.1 +POST http://localhost/nomad/api/uploads HTTP/1.1 content-type: application/json {