Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jobs): fence db create job #977

Merged
merged 3 commits into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gen3/bin/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ run_setup_jobs() {
# sheepdog wants its transaction tables to exist at startup
# jobs run asynchronously ...
#
for jobName in gdcdb-create indexd-userdb; do
for jobName in gdcdb-create indexd-userdb fence-db-migrate; do
echo "Launching job $jobName"
gen3 job run $jobName
done
echo "Waiting for jobs to finish, and late starting services to come up"
sleep 5
gen3 kube-wait4-pods
for jobName in gdcdb-create indexd-userdb; do
for jobName in gdcdb-create indexd-userdb fence-db-migrate; do
echo "--------------------"
echo "Logs for $jobName"
gen3 job logs "$jobName"
Expand Down
57 changes: 57 additions & 0 deletions kube/services/jobs/fence-db-migrate-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: fence-db-migrate
spec:
template:
metadata:
labels:
app: gen3job
spec:
serviceAccountName: useryaml-job
volumes:
- name: config-volume
secret:
secretName: "fence-config"
- name: fence-google-app-creds-secret-volume
secret:
secretName: "fence-google-app-creds-secret"
- name: fence-google-storage-creds-secret-volume
secret:
secretName: "fence-google-storage-creds-secret"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(google stuff) probably not needed?

- name: fence-yaml
configMap:
name: fence
containers:
- name: fence
GEN3_FENCE_IMAGE
imagePullPolicy: Always
env:
- name: PYTHONPATH
value: /var/www/fence
volumeMounts:
- name: "config-volume"
readOnly: true
mountPath: "/var/www/fence/fence-config.yaml"
subPath: fence-config.yaml
- name: "fence-google-app-creds-secret-volume"
readOnly: true
mountPath: "/var/www/fence/fence_google_app_creds_secret.json"
subPath: fence_google_app_creds_secret.json
- name: "fence-google-storage-creds-secret-volume"
readOnly: true
mountPath: "/var/www/fence/fence_google_storage_creds_secret.json"
subPath: fence_google_storage_creds_secret.json
- name: "fence-yaml"
mountPath: "/var/www/fence/user.yaml"
subPath: user.yaml
command: ["/bin/bash"]
args:
- "-c"
- |
fence-create migrate
if [[ $? != 0 ]]; then
echo "WARNING: non zero exit code: $?"
fi
restartPolicy: Never