Skip to content

Commit

Permalink
re apply reana cronjobs (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
garciagenrique authored Jun 19, 2024
1 parent dbed067 commit f08eb6c
Showing 1 changed file with 111 additions and 76 deletions.
187 changes: 111 additions & 76 deletions infrastructure/cluster/flux-v2/reana/reana-iam-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,76 +1,111 @@
# apiVersion: batch/v1
# kind: CronJob
# metadata:
# name: iam-reana-sync
# namespace: reana
# spec:
# schedule: "0 1 * * *" # every day at 1 am
# concurrencyPolicy: Forbid
# successfulJobsHistoryLimit: 1
# jobTemplate:
# spec:
# template:
# spec:
# restartPolicy: OnFailure
# containers:
# - name: iam-sync
# image: ghcr.io/vre-hub/vre-iam-reana-sync:v1.0.0-rc0-35-02757b7 # to be changed to correct version

# env:

# # needed to poll the iam service

# - name: IAM_SERVER
# value: "https://iam-escape.cloud.cnaf.infn.it"
# - name: CLIENT_SECRET
# valueFrom:
# secretKeyRef:
# name: reana-vre-iam-client
# key: client_secret
# - name: CLIENT_ID
# valueFrom:
# secretKeyRef:
# name: reana-vre-iam-client
# key: client_id

# # needed to add users
# - name: REANA_ADMIN_TOKEN
# valueFrom:
# secretKeyRef:
# name: reana-admin-access-token
# key: ADMIN_ACCESS_TOKEN

# # needed for correct DB connection - internals of reana
# - name: REANA_SECRET_KEY
# valueFrom:
# secretKeyRef:
# name: reana-secrets
# key: REANA_SECRET_KEY

# # to connect to DB
# - name: REANA_DB_NAME
# value: "reana"
# - name: REANA_DB_PORT
# value: "6600"
# - name: REANA_DB_HOST
# value: "dbod-vre.cern.ch"
# - name: REANA_DB_USERNAME
# valueFrom:
# secretKeyRef:
# name: reana-db
# key: user
# - name: REANA_DB_PASSWORD
# valueFrom:
# secretKeyRef:
# name: reana-db
# key: password

# tty: true
# imagePullPolicy: Always
# command:
# - /bin/sh
# - -c
# - date; echo Hello from iam-reana-sync container;
# flask reana-admin user-list --admin-access-token $REANA_ADMIN_TOKEN;
# python3 /home/generate_email_list.py;
# python3 /home/add_reana_users.py
apiVersion: batch/v1
kind: CronJob
metadata:
name: iam-reana-sync
namespace: reana
spec:
schedule: "0 1 * * *" # every day at 1 am
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: iam-sync
image: ghcr.io/vre-hub/vre-iam-reana-sync:v1.0.0-rc0-35-02757b7 # to be changed to correct version
env:
# needed to poll the iam service
- name: IAM_SERVER
value: "https://iam-escape.cloud.cnaf.infn.it"
- name: CLIENT_SECRET
valueFrom:
secretKeyRef:
name: reana-vre-iam-client
key: client_secret
- name: CLIENT_ID
valueFrom:
secretKeyRef:
name: reana-vre-iam-client
key: client_id
# needed to add users
- name: REANA_ADMIN_TOKEN
valueFrom:
secretKeyRef:
name: reana-admin-access-token
key: ADMIN_ACCESS_TOKEN
# needed for correct DB connection - internals of reana
- name: REANA_SECRET_KEY
valueFrom:
secretKeyRef:
name: reana-secrets
key: REANA_SECRET_KEY
# to connect to DB
- name: REANA_DB_NAME
value: "reana"
- name: REANA_DB_PORT
value: "6600"
- name: REANA_DB_HOST
value: "dbod-vre.cern.ch"
- name: REANA_DB_USERNAME
valueFrom:
secretKeyRef:
name: reana-db
key: user
- name: REANA_DB_PASSWORD
valueFrom:
secretKeyRef:
name: reana-db
key: password
tty: true
imagePullPolicy: Always
command:
- /bin/sh
- -c
- date; echo Hello from iam-reana-sync container;
flask reana-admin user-list --admin-access-token $REANA_ADMIN_TOKEN;
python3 /home/generate_email_list.py;
python3 /home/add_reana_users.py
---
apiVersion: v1
kind: Pod
metadata:
name: reana-client
namespace: reana
spec:
containers:
- name: rucio-client
image: ghcr.io/vre-hub/vre-iam-reana-sync:v1.0.0-rc0-35-02757b7
imagePullPolicy: Always
command: ["sleep","3600"]
env:
# needed to add users
- name: REANA_ADMIN_TOKEN
valueFrom:
secretKeyRef:
name: reana-admin-access-token
key: ADMIN_ACCESS_TOKEN
# needed for correct DB connection - internals of reana
- name: REANA_SECRET_KEY
valueFrom:
secretKeyRef:
name: reana-secrets
key: REANA_SECRET_KEY
# to connect to DB
- name: REANA_DB_NAME
value: "reana"
- name: REANA_DB_PORT
value: "6600"
- name: REANA_DB_HOST
value: "dbod-vre.cern.ch"
- name: REANA_DB_USERNAME
valueFrom:
secretKeyRef:
name: reana-db
key: user
- name: REANA_DB_PASSWORD
valueFrom:
secretKeyRef:
name: reana-db
key: password

0 comments on commit f08eb6c

Please sign in to comment.