Skip to content
Permalink
Browse files

Deploy BayesWaves on Kubernetes from a registry

  • Loading branch information
tmiddelkoop committed Jun 22, 2021
1 parent 04664b1 commit cd2c0b44095cb7b64381a9787ab394210df40299
Showing with 86 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +33 −1 ReadMe.md
  3. +51 −0 bayeswave.yaml
@@ -0,0 +1,2 @@
config
token
@@ -26,7 +26,7 @@ docker run -it --rm bayeswave:latest -- BayesWave \
--Niter 500 --outputDir master-test
```

Run example inside container (incomplete/fails)
Run example workflow inside container (incomplete/fails), skip this.
```bash
docker run -it --rm bayeswave:latest -- /bin/bash
install -dv /data ; cd /data
@@ -38,3 +38,35 @@ sed -i -e 's|BAYESWAVE_PREFIX|/opt/bayeswave|g' LDG-GW150914.ini
bash makework-LDG-GW150914.sh
```

Setup login credentials using a "personal access token" stored in the file `token` in the following form:
```bash
REGISTRY_NAME="registry DNS name e.g. ghcr.io"
REGISTRY_TOKEN="personal access token"
REGISTRY_USER="user"
```

```bash
. ./token
echo $REGISTRY_TOKEN | docker login $REGISTRY_NAME -u $REGISTRY_USER --password-stdin
```

Push container to the registry.
```bash
. ./token
docker tag conda-env:latest $REGISTRY_NAME/$REGISTRY_USER/conda-env:latest
docker push $REGISTRY_NAME/$REGISTRY_USER/conda-env:latest
docker tag bayeswave:latest $REGISTRY_NAME/$REGISTRY_USER/bayeswave:latest
docker push $REGISTRY_NAME/$REGISTRY_USER/bayeswave:latest
```

Store token in Kubernetes cluster
```bash
kubectl create secret docker-registry registry-secret --docker-server="$REGISTRY_NAME" --docker-username="$REGISTRY_USER" --docker-password="$REGISTRY_TOKEN"
```

Deploy container as a Job. Assumes working kubectl and a default namespace. Note the evnsubst replaces the envrionment variables with their values.
```bash
. ./token
export REGISTRY_NAME REGISTRY_USER
cat bayeswave.yaml | envsubst | kubectl apply -f -
```
@@ -0,0 +1,51 @@
apiVersion: batch/v1
kind: Job
metadata:
name: bayeswave-job
spec:
template:
spec:
containers:
- name: bayeswave
resources:
requests:
memory: 500Mi
cpu: 250m
limits:
memory: 500Mi
cpu: 250m
image: $REGISTRY_URL/$REGISTRY_USER/bayeswave:latest
command:
- BayesWave
args:
- --ifo
- "H1"
- --H1-flow
- "32"
- --H1-cache
- "LALSimAdLIGO"
- --H1-channel
- "LALSimAdLIGO"
- --trigtime
- "900000000.00"
- --srate
- "512"
- --seglen
- "4"
- --PSDstart
- "900000000"
- --PSDlength
- "1024"
- --NCmin
- "2"
- --NCmax
- "2"
- --dataseed
- "1234"
- --Niter
- "500"
- --outputDir
- "master-test"
imagePullSecrets:
- name: registry-secret
restartPolicy: Never

0 comments on commit cd2c0b4

Please sign in to comment.
You can’t perform that action at this time.