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
c13bc9b6
Commit
c13bc9b6
authored
Aug 27, 2018
by
Markus Scheidgen
Browse files
Working infra.
parent
5ab4189c
Changes
6
Hide whitespace changes
Inline
Side-by-side
gui/nginx.conf
View file @
c13bc9b6
server
{
listen
80
;
server_name
www.example.com
;
location
/nomadxt
{
root
/app/
;
root
/app/
;
}
location
/nomadxt/api
{
proxy_set_header
Host
$http_host
;
proxy_pass
http://api:8000
;
}
location
~
^/nomadxt/objects/(.*)$
{
resolver
127
.0.0.11
ipv6=off
;
# docker embedded DNS
proxy_pass
http://minio:9000/
$1
;
client_max_body_size
20g
;
resolver
127
.0.0.11
ipv6=off
;
# docker embedded DNS
proxy_set_header
Host
$http_host
;
proxy_pass
http://minio:9000/
$1
;
}
}
infrastructure/.gitignore
deleted
100644 → 0
View file @
5ab4189c
data/
config/
infrastructure/nomadxt/docker-compose.yml
View file @
c13bc9b6
...
...
@@ -25,12 +25,25 @@ services:
-
${MINIO_HOST_PORT}:9000
volumes
:
-
${VOLUME_BINDS}/minio:/data
-
../config/minio:/root/.minio
environment
:
-
MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
-
MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
command
:
server /data
minio-config
:
image
:
minio/mc
links
:
-
minio
entrypoint
:
/bin/sh -c "
sleep 5;
/usr/bin/mc config host add minio http://minio:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY;
/usr/bin/mc mb minio/uploads -p;
/usr/bin/mc mb minio/archive -p;
/usr/bin/mc mb minio/repository -p;
/usr/bin/mc policy download minio/repository;
/usr/bin/mc policy download minio/archive;
/usr/bin/mc policy upload minio/uploads;"
# broker for celery
rabbitmq
:
restart
:
always
...
...
infrastructure/up-wo-elk.sh
deleted
100644 → 0
View file @
5ab4189c
#!/bin/sh
docker-compose up minio rabbitmq redis
\ No newline at end of file
nomad/api.py
View file @
c13bc9b6
...
...
@@ -30,10 +30,13 @@ if me is None:
def
_external_objects_url
(
url
):
""" Replaces the given internal object storage url (minio) with an URL that allows
external access. """
port_with_color
=
''
if
config
.
services
.
objects_port
>
0
else
':%d'
%
config
.
services
.
objects_port
port_with_colon
=
''
if
config
.
services
.
objects_port
>
0
:
port_with_colon
=
':%d'
%
config
.
services
.
objects_port
return
url
.
replace
(
'%s:%s'
%
(
config
.
minio
.
host
,
config
.
minio
.
port
),
'%s
:
%s%s'
%
(
config
.
services
.
objects_host
,
port_with_colo
r
,
config
.
services
.
objects_base_path
))
'%s%s%s'
%
(
config
.
services
.
objects_host
,
port_with_colo
n
,
config
.
services
.
objects_base_path
))
class
Uploads
(
Resource
):
...
...
@@ -50,6 +53,7 @@ class Uploads(Resource):
'name'
:
upload
.
name
,
'upload_id'
:
upload
.
upload_id
,
'presigned_url'
:
_external_objects_url
(
upload
.
presigned_url
),
'presigned_orig'
:
upload
.
presigned_url
,
'create_time'
:
upload
.
create_time
.
isoformat
()
if
upload
.
create_time
is
not
None
else
None
,
'upload_time'
:
upload
.
upload_time
.
isoformat
()
if
upload
.
upload_time
is
not
None
else
None
,
'proc_time'
:
upload
.
proc_time
.
isoformat
()
if
upload
.
proc_time
is
not
None
else
None
,
...
...
nomad/config.py
View file @
c13bc9b6
...
...
@@ -92,6 +92,6 @@ logstash = LogstashConfig(
services
=
NomadServicesConfig
(
api_base_path
=
os
.
environ
.
get
(
'NOMAD_API_BASE_PATH'
,
''
),
objects_host
=
os
.
environ
.
get
(
'NOMAD_OBJECTS_HOST'
,
'localhost'
),
objects_port
=
int
(
os
.
environ
.
get
(
'NOMAD_OBJECTS_PORT'
,
-
1
)),
objects_port
=
int
(
os
.
environ
.
get
(
'NOMAD_OBJECTS_PORT'
,
minio
.
port
)),
objects_base_path
=
os
.
environ
.
get
(
'NOMAD_OBJECTS_BASE_PATH'
,
''
)
)
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