Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
container-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
container-manager
Commits
edd3242c
Commit
edd3242c
authored
6 years ago
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
Options
Downloads
Patches
Plain Diff
improve deployment of container manager
parent
f606fa97
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deploy.sh
+42
-15
42 additions, 15 deletions
deploy.sh
with
42 additions
and
15 deletions
deploy.sh
+
42
−
15
View file @
edd3242c
...
@@ -2,14 +2,17 @@
...
@@ -2,14 +2,17 @@
nomadRoot
=
${
nomadRoot
:-
/nomad/nomadlab
}
nomadRoot
=
${
nomadRoot
:-
/nomad/nomadlab
}
buildDocker
=
1
buildDocker
=
1
updateDeploy
=
1
updateDeploy
=
1
imageType
=
beaker
target_hostname
=
${
target_hostname
:-
$HOSTNAME
}
target_hostname
=
${
target_hostname
:-
$HOSTNAME
}
chownRoot
=
chownRoot
=
tls
=
tls
=
debug
=
while
test
${#}
-gt
0
while
test
${#}
-gt
0
do
do
case
"
$1
"
in
case
"
$1
"
in
--debug
)
debug
=
1
;;
--tls
)
--tls
)
tls
=
--tls
tls
=
--tls
;;
;;
...
@@ -21,10 +24,6 @@ do
...
@@ -21,10 +24,6 @@ do
buildDocker
=
""
buildDocker
=
""
updateDeploy
=
1
updateDeploy
=
1
;;
;;
--image-type
)
shift
imageType
=
$1
;;
--target-hostname
)
--target-hostname
)
shift
shift
target_hostname
=
$1
target_hostname
=
$1
...
@@ -38,7 +37,7 @@ do
...
@@ -38,7 +37,7 @@ do
chownRoot
=
$1
chownRoot
=
$1
;;
;;
*
)
*
)
echo
"usage:
$0
[--tls] [--nomad-root <pathToNomadRoot>] [--chown-root <pathForPrometheusVolumes>] [--docker-only] [--docker-skip] [--target-hostname hostname]"
echo
"usage:
$0
[--debug]
[--tls] [--nomad-root <pathToNomadRoot>] [--chown-root <pathForPrometheusVolumes>] [--docker-only] [--docker-skip] [--target-hostname hostname]"
echo
echo
echo
"Env variables: NODE_ENV, target_hostname, nomadRoot"
echo
"Env variables: NODE_ENV, target_hostname, nomadRoot"
echo
"Examples:"
echo
"Examples:"
...
@@ -298,10 +297,13 @@ metadata:
...
@@ -298,10 +297,13 @@ metadata:
EOF
EOF
fi
fi
echo
" kubectl create -f container-manager-namespace.yaml"
echo
" kubectl create -f container-manager-namespace.yaml"
echo
for
imageType
in
beaker jupyter creedo remotevis
;
do
echo
"## Initial setup: create container manager service"
echo
"##
$imageType
Initial setup: create container manager service"
if
[
-n
updateDeploy
]
;
then
if
[
-n
updateDeploy
]
;
then
cat
>
container-manager-service.yaml
<<
HERE
cat
>
container-manager-service
-
$imageType
.yaml
<<
HERE
kind: Service
kind: Service
apiVersion: v1
apiVersion: v1
metadata:
metadata:
...
@@ -320,7 +322,7 @@ fi
...
@@ -320,7 +322,7 @@ fi
echo
" kubectl create -f container-manager-service.yaml"
echo
" kubectl create -f container-manager-service.yaml"
if
[
-n
updateDeploy
]
;
then
if
[
-n
updateDeploy
]
;
then
cat
>
container-manager-deploy.yaml
<<
HERE
cat
>
container-manager-deploy
-
$imageType
.yaml
<<
HERE
apiVersion: apps/v1beta2
apiVersion: apps/v1beta2
kind: Deployment
kind: Deployment
metadata:
metadata:
...
@@ -352,13 +354,38 @@ spec:
...
@@ -352,13 +354,38 @@ spec:
- containerPort: 3003
- containerPort: 3003
env:
env:
- name: SESSION_DB_PASSWORD
- name: SESSION_DB_PASSWORD
value: "
$redisPass
"
valueFrom:
secretKeyRef:
name: user-settings-db
key: redis-password
- name: NOTEBOOK_INFO_DB_PASSWORD
- name: NOTEBOOK_INFO_DB_PASSWORD
value: "
$mongoPass
"
valueFrom:
secretKeyRef:
name: notebook-db-mongo-pwd
key: password
- name: NODE_ENV
value: "
$nodeEnv
"
- name: NODE_APP_INSTANCE
value: "
$imageType
"
HERE
HERE
if
[
-n
"
$debug
"
]
;
then
cat
>>
container-manager-deploy-
$imageType
.yaml
<<
EOF
volumeMounts:
- mountPath: /app
name: app-source
volumes:
- name: app-source
hostPath:
path:
$nomadRoot
/servers/
$target_hostname
/analytics/
$imageType
EOF
fi
fi
fi
echo
"# For an initial deployment, launch with:"
echo
"if ! kubectl get deployment nomad-container-manager-
$imageType
>& /dev/null ; then"
echo
"kubectl create --save-config -f container-manager-deploy.yaml"
echo
" kubectl create --save-config -f container-manager-deploy-
$imageType
.yaml"
echo
"# To simply update the deployment:"
echo
"else"
echo
"kubectl apply -f container-manager-deploy.yaml"
echo
" kubectl apply -f container-manager-deploy-
$imageType
.yaml"
echo
"fi"
echo
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment