Skip to content
Permalink
cd2c0b4409
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
72 lines (59 sloc) 2.42 KB
# CLASS Examples
## OSG Container
Example based on the OSG example (https://docs.ligo.org/lscsoft/bayeswave/running.html) of BayesWave (https://git.ligo.org/lscsoft/bayeswave).
### Using a Pre-Built Container on Docker
```bash
sudo apt install cmake -y
cd projects
git clone https://git.ligo.org/lscsoft/bayeswave
cd bayeswave
docker build -t conda-env --file .conda-env.Dockerfile .
docker build -t bayeswave --build-arg BUILD_IMAGE=conda-env:latest ./
```
Simple test example
```bash
docker run -it --rm bayeswave:latest -- BayesWave \
--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
```
Run example workflow inside container (incomplete/fails), skip this.
```bash
docker run -it --rm bayeswave:latest -- /bin/bash
install -dv /data ; cd /data
curl -O https://git.ligo.org/lscsoft/bayeswave/-/raw/master/BayesWaveUtils/bayeswave_pipe_examples/LDG-GW150914/LDG-GW150914.ini
curl -O https://git.ligo.org/lscsoft/bayeswave/-/raw/master/BayesWaveUtils/bayeswave_pipe_examples/LDG-GW150914/makework-LDG-GW150914.sh
pip install gwdatafind
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 -
```