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
5768e3db
Commit
5768e3db
authored
Mar 23, 2019
by
Markus Scheidgen
Browse files
Fixes to helm deployment.
parent
a365f8a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
nomad/config.py
View file @
5768e3db
...
...
@@ -223,8 +223,8 @@ def apply(config, key, value) -> None:
child_config
[
child_key
]
=
value
def
load_config
(
config_file
:
str
=
os
.
environ
.
get
(
'NOMAD_CONFIG'
,
'nomad.yml'
))
->
None
:
# load yml and override defaults
def
load_config
(
config_file
:
str
=
os
.
environ
.
get
(
'NOMAD_CONFIG'
,
'nomad.y
a
ml'
))
->
None
:
# load y
a
ml and override defaults
if
os
.
path
.
exists
(
config_file
):
with
open
(
config_file
,
'r'
)
as
stream
:
try
:
...
...
@@ -257,7 +257,7 @@ def load_config(config_file: str = os.environ.get('NOMAD_CONFIG', 'nomad.yml'))
adapt
(
globals
(),
config_data
)
# load env and override yml and defaults
# load env and override y
a
ml and defaults
kwargs
=
{
key
[
len
(
'NOMAD_'
):].
lower
():
value
for
key
,
value
in
os
.
environ
.
items
()
...
...
ops/helm/nomad/templates/api-deployment.yaml
View file @
5768e3db
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
{{
include "nomad.fullname" .
}}
-api-gunicorn-log-config
labels
:
app.kubernetes.io/name
:
{{
include "nomad.name" .
}}
-api-gunicorn-log-config
helm.sh/chart
:
{{
include "nomad.chart" .
}}
app.kubernetes.io/instance
:
{{
.Release.Name
}}
app.kubernetes.io/managed-by
:
{{
.Release.Service
}}
data
:
gunicorn.log.conf
:
|
[loggers]
keys=root, gunicorn.error, gunicorn.access
[handlers]
keys=console, access, error
[formatters]
keys=generic
[logger_root]
level=INFO
handlers=console
[logger_gunicorn.error]
level=INFO
handlers=error
qualname=gunicorn.error
[logger_gunicorn.access]
level=INFO
handlers=access
qualname=gunicorn.access
[handler_console]
class=StreamHandler
formatter=generic
args=(sys.stdout, )
[handler_access]
class=StreamHandler
formatter=generic
args=(sys.stdout, )
[handler_error]
class=StreamHandler
formatter=generic
args=(sys.stdout, )
[formatter_generic]
format=%(asctime)s [%(process)d] [%(levelname)s] %(message)s
datefmt=%Y-%m-%d %H:%M:%S
class=logging.Formatter
---
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
...
...
@@ -23,22 +77,26 @@ spec:
-
name
:
{{
include "nomad.name" .
}}
-api
image
:
"
{{
.Values.images.nomad.name
}}:{{
.Values.images.nomad.tag
}}"
volumeMounts
:
-
mountPath
:
/app
-
mountPath
:
/app
/nomad.yaml
name
:
nomad-conf
subPath
:
nomad.yaml
-
mountPath
:
/app/gunicorn.log.conf
name
:
gunicorn-log-conf
subPath
:
gunicorn.log.conf
-
mountPath
:
/app/.volumes/fs/public
name
:
public-volume
-
mountPath
:
/app/.volumes/fs/staging
name
:
staging-volume
-
mountPath
:
/nomad
name
:
nomad-volume
env
:
env
:
-
name
:
NOMAD_SERVICE
value
:
"
api"
-
name
:
NOMAD_CONSOLE_LOGLEVEL
value
:
"
{{
.Values.api.console_loglevel
}}"
-
name
:
NOMAD_LOGSTASH_LEVEL
value
:
"
{{
.Values.api.logstash_loglevel
}}"
command
:
[
"
python"
,
"
-m"
,
"
gunicorn.app.wsgiapp"
,
"
--timeout"
,
"
3600"
,
"
--log-config"
,
"
ops/
gunicorn.log.conf"
,
"
-w"
,
"
{{
.Values.api.worker
}}"
,
"
-b
0.0.0.0:8000"
,
"
nomad.api:app"
]
command
:
[
"
python"
,
"
-m"
,
"
gunicorn.app.wsgiapp"
,
"
--timeout"
,
"
3600"
,
"
--log-config"
,
"
gunicorn.log.conf"
,
"
-w"
,
"
{{
.Values.api.worker
}}"
,
"
-b
0.0.0.0:8000"
,
"
nomad.api:app"
]
livenessProbe
:
httpGet
:
path
:
"
{{
.Values.proxy.external.path
}}/api/alive"
...
...
@@ -57,12 +115,12 @@ spec:
-
name
:
{{
.Values.images.secret
}}
imagePullPolicy
:
always
volumes
:
-
name
:
gunicorn-log-conf
configMap
:
name
:
{{
include "nomad.fullname" .
}}
-api-gunicorn-log-config
-
name
:
nomad-conf
configMap
:
name
:
{{
include "nomad.fullname" .
}}
-configmap
items
:
-
key
:
nomad.yml
path
:
nomad.yml
-
name
:
public-volume
hostPath
:
path
:
{{
.Values.volumes.public
}}
...
...
ops/helm/nomad/templates/nomad-configmap.yml
View file @
5768e3db
...
...
@@ -8,9 +8,7 @@ metadata:
app.kubernetes.io/instance
:
{{
.Release.Name
}}
app.kubernetes.io/managed-by
:
{{
.Release.Service
}}
data
:
nomad.yml
:
/
service
:
api
api_host
:
nomad.yaml
:
|
release: "{{ .Release.Name }}"
fs:
tmp: "{{ .Values.volumes.tmp }}"
...
...
@@ -19,8 +17,6 @@ data:
enabled: true
host: "{{ .Values.logstash.host }}"
tcpport: "{{ .Values.logstash.port }}"
level
:
info
console_log_level
:
debug
services:
api_host: "{{ .Values.proxy.external.host }}"
api_port: "{{ .Values.proxy.external.port }}"
...
...
@@ -50,4 +46,4 @@ data:
user: "{{ .Values.mail.user }}"
password: "{{ .Values.mail.password }}"
from_address: "{{ .Values.mail.from }}"
celery_routing
:
"
{{
.Values.worker.routing
}}"
\ No newline at end of file
celery_routing: "{{ .Values.worker.routing }}"
ops/helm/nomad/templates/worker-deployment.yaml
View file @
5768e3db
...
...
@@ -28,8 +28,9 @@ spec:
requests
:
memory
:
"
{{
.Values.worker.memrequest
}}Gi"
volumeMounts
:
-
mountPath
:
/app
-
mountPath
:
/app
/nomad.yaml
name
:
nomad-conf
subPath
:
nomad.yaml
-
mountPath
:
/app/.volumes/fs/public
name
:
public-volume
-
mountPath
:
/app/.volumes/fs/staging
...
...
@@ -69,9 +70,6 @@ spec:
-
name
:
nomad-conf
configMap
:
name
:
{{
include "nomad.fullname" .
}}
-configmap
items
:
-
key
:
nomad.yml
path
:
nomad.yml
-
name
:
public-volume
hostPath
:
path
:
{{
.Values.volumes.public
}}
...
...
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