Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
41b578a2
Commit
41b578a2
authored
Sep 18, 2018
by
Markus Scheidgen
Browse files
Renamed everything from nomadxt to nomad.
parent
a7ba32f8
Changes
19
Hide whitespace changes
Inline
Side-by-side
backend.Dockerfile
View file @
41b578a2
...
...
@@ -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
nomad
xt
_requirements:latest
as
requirements
FROM
nomad_requirements:latest
as
requirements
# we use slim for the final image
FROM
python:3.6-slim
as
final
...
...
docs/setup.md
View file @
41b578a2
...
...
@@ -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
`nomad
xt
_requirements`
:
Build the requirements image tagged
`nomad_requirements`
:
```
docker build -t nomad
xt
_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/nomad
xt
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/nomad
xt
/.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.
...
...
frontend.Dockerfile
View file @
41b578a2
...
...
@@ -13,5 +13,5 @@ RUN yarn build
# production environment
FROM
nginx:1.13.9-alpine
COPY
--from=builder /nomad/app/build /app/nomad
xt
COPY
--from=builder /nomad/app/build /app/nomad
CMD
["nginx", "-g", "daemon off;"]
gui/.env.development
View file @
41b578a2
REACT_APP_API_BASE = 'http://localhost:8000/nomad
xt
/api'
REACT_APP_API_BASE = 'http://localhost:8000/nomad/api'
REACT_APP_OBJECT_BASE = 'http://localhost:9007'
REACT_APP_APP_BASE = '/nomad
xt
'
REACT_APP_APP_BASE = '/nomad'
REACT_APP_APP_STATIC_BASE = ''
REACT_APP_DEBUG = 'true'
\ No newline at end of file
gui/.env.production
View file @
41b578a2
REACT_APP_API_BASE = '/nomad
xt
/api'
REACT_APP_OBJECT_BASE = '/nomad
xt
/objects'
REACT_APP_APP_BASE = '/nomad
xt
'
REACT_APP_APP_STATIC_BASE = '/nomad
xt
'
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
gui/package.json
View file @
41b578a2
...
...
@@ -40,5 +40,5 @@
"eslint-plugin-standard"
:
"^3.1.0"
,
"serve"
:
"^10.0.0"
},
"homepage"
:
"http://mywebsite.com/nomad
xt
"
"homepage"
:
"http://mywebsite.com/nomad"
}
gui/src/components/Development.js
View file @
41b578a2
...
...
@@ -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](/nomad
xt
/kibana/)
\n\n[Link to Kiaba](/nomad/kibana/)
`
}
<
/Markdown
>
<
/div
>
)
...
...
infrastructure/elk/README.md
View file @
41b578a2
...
...
@@ -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="/nomad
xt
/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 ~ ^/nomad
xt
/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;
...
...
infrastructure/elk/kibana.yml
View file @
41b578a2
...
...
@@ -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
:
"
/nomad
xt
/kibana"
server.basePath
:
"
/nomad/kibana"
# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576
infrastructure/elk/run_elk.sh
View file @
41b578a2
#!/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
infrastructure/nomadxt/.env_processing
View file @
41b578a2
...
...
@@ -9,6 +9,6 @@ API_HOST_PORT=18000
GUI_HOST_PORT=18080
APP_HOST_PORT=0.0.0.0:10080
VOLUME_BINDS=/scratch/nomad
xt
VOLUME_BINDS=/scratch/nomad
_FAIR
EXTERNAL_HOST=enc-staging-nomad.esc.rzg.mpg.de
EXTERNAL_PORT=80
infrastructure/nomadxt/docker-compose.yml
View file @
41b578a2
...
...
@@ -20,7 +20,7 @@ services:
restart
:
always
image
:
minio/minio:RELEASE.2018-06-08T03-49-38Z
# image: minio/minio
container_name
:
nomad
xt
_minio
container_name
:
nomad_minio
ports
:
-
${MINIO_HOST_PORT}:9000
volumes
:
...
...
@@ -48,7 +48,7 @@ services:
rabbitmq
:
restart
:
always
image
:
rabbitmq
container_name
:
nomad
xt
_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
:
-
nomad
xt
_rabbitmq:/var/lib/rabbitmq
-
nomad_rabbitmq:/var/lib/rabbitmq
# the search engine
elastic
:
image
:
docker.elastic.co/elasticsearch/elasticsearch:6.3.2
container_name
:
nomad
xt
_elastic
container_name
:
nomad_elastic
volumes
:
-
nomad
xt
_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
:
nomad
xt
_mongo
container_name
:
nomad_mongo
environment
:
-
MONGO_DATA_DIR=/data/db
-
MONGO_LOG_DIR=/dev/null
volumes
:
-
nomad
xt
_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
:
nomad
xt
_elk
container_name
:
nomad_elk
expose
:
-
5000
# logstash beats
-
5044
# logstash tcp
volumes
:
-
nomad
xt
_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
:
nomad
xt
_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=nomad
xt
_worker
-
NOMAD_SERVICE=nomad_worker
links
:
-
minio
-
rabbitmq
...
...
@@ -125,7 +125,7 @@ services:
build
:
context
:
../../
dockerfile
:
backend.Dockerfile
container_name
:
nomad
xt
_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=nomad
xt
_handler
-
NOMAD_SERVICE=nomad_handler
links
:
-
minio
-
rabbitmq
...
...
@@ -148,7 +148,7 @@ services:
build
:
context
:
../../
dockerfile
:
backend.Dockerfile
container_name
:
nomad
xt
_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=/nomad
xt
/api
-
NOMAD_API_BASE_PATH=/nomad/api
-
NOMAD_OBJECTS_HOST=${EXTERNAL_HOST}
-
NOMAD_OBJECTS_PORT=${EXTERNAL_PORT}
-
NOMAD_OBJECTS_BASE_PATH=/nomad
xt
/objects
-
NOMAD_SERVICE=nomad
xt
_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
:
nomad
xt
_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
:
nomad
xt
_proxy
container_name
:
nomad_proxy
links
:
-
elk
-
gui
...
...
@@ -200,11 +200,11 @@ services:
command
:
nginx -g 'daemon off;'
volumes
:
nomad
xt
_minio
:
nomad
xt
_mongo
:
nomad
xt
_elastic
:
nomad
xt
_redis
:
nomad
xt
_rabbitmq
:
nomad
xt
_elk
:
nomad_minio
:
nomad_mongo
:
nomad_elastic
:
nomad_redis
:
nomad_rabbitmq
:
nomad_elk
:
infrastructure/nomadxt/gui.conf
View file @
41b578a2
...
...
@@ -2,8 +2,8 @@ server {
listen
8080
;
server_name
www
.
example
.
com
;
location
/
nomad
xt
{
location
/
nomad
{
root
/
app
/;
try_files
$
uri
/
nomad
xt
/
index
.
html
;
# fall back to index.html to support routing
try_files
$
uri
/
nomad
/
index
.
html
;
# fall back to index.html to support routing
}
}
infrastructure/nomadxt/nginx.conf
View file @
41b578a2
...
...
@@ -2,19 +2,19 @@ server {
listen
80
;
server_name
www.example.com
;
location
/nomad
xt
{
location
/nomad
{
proxy_pass
http://gui:8080
;
proxy_set_header
Host
$host
;
proxy_set_header
X-Real-IP
$remote_addr
;
}
location
/nomad
xt
/api
{
location
/nomad/api
{
proxy_set_header
Host
$host
;
proxy_pass_request_headers
on
;
proxy_pass
http://api:8000
;
}
location
~
^/nomad
xt
/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
~
^/nomad
xt
/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
;
...
...
infrastructure/utils.http
View file @
41b578a2
...
...
@@ -43,9 +43,9 @@ content-type: application/json
}
###
POST http://localhost:8000/nomad
xt
/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//nomad
xt
/api/uploads HTTP/1.1
GET http://enc-staging-nomad.esc.rzg.mpg.de//nomad/api/uploads HTTP/1.1
Authorization: Basic bWVAZ21haWwuY29tOm5vbWFk
nomad/api.py
View file @
41b578a2
...
...
@@ -87,7 +87,7 @@ class UploadsRes(Resource):
.. sourcecode:: http
GET /nomad
xt
/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 /nomad
xt
/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 /nomad
xt
/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 /nomad
xt
/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 /nomad
xt
/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 /nomad
xt
/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 /nomad
xt
/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 /nomad
xt
/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)
...
...
nomad/client.py
View file @
41b578a2
...
...
@@ -24,7 +24,7 @@ import sys
import
requests
from
requests.auth
import
HTTPBasicAuth
api_base
=
'http://localhost/nomad
xt
/api'
api_base
=
'http://localhost/nomad/api'
def
upload_file
(
file_path
,
name
=
None
,
user
=
'other@gmail.com'
,
pw
=
'nomad'
):
...
...
nomad/config.py
View file @
41b578a2
...
...
@@ -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'
,
'/nomad
xt
/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'
,
''
),
...
...
tests/misc.http
View file @
41b578a2
GET http://localhost/nomad
xt
/api/uploads HTTP/1.1
GET http://localhost/nomad/api/uploads HTTP/1.1
###
POST http://localhost/nomad
xt
/api/uploads HTTP/1.1
POST http://localhost/nomad/api/uploads HTTP/1.1
content-type: application/json
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment