Skip to content

Commit

Permalink
dask jlab image
Browse files Browse the repository at this point in the history
  • Loading branch information
dciangot committed Aug 16, 2021
1 parent 40f9441 commit d452815
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/dask.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: dask build

on:
push:
tags:
- "*-dask"

jobs:
dask:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: dodasts/jhub # list of Docker images to use as base name for tags
tag-sha: true # add git short SHA as Docker tag
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./docker/htcondor/dask
file: ./docker/htcondor/dask/Dockerfile
platforms: linux/amd64,linux/arm64,linux/386
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
2 changes: 1 addition & 1 deletion .github/workflows/jhub.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: jhub build

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spark.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: spark builld

on:
push:
Expand Down
8 changes: 8 additions & 0 deletions docker/htcondor/dask/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM mircot/htcondordask:v5

RUN pip3 install dask-remote-jobqueue==v0.3.2

COPY labextension.yaml /usr/local/lib/python3.6/site-packages/dask_labextension/labextension.yaml
COPY spawn.sh /.init/spawn.sh
RUN echo "source ~/htc.rc" >> ~/.bashrc
COPY kernel.json /usr/local/share/jupyter/kernels/python3/kernel.json
8 changes: 8 additions & 0 deletions docker/htcondor/dask/kernel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"argv": [
"bash", "-c",
"source ~/htc.rc; source /usr/local/share/root6/bin/thisroot.sh; python3 -m ipykernel_launcher -f {connection_file}"
],
"display_name": "Python 3",
"language": "python"
}
9 changes: 9 additions & 0 deletions docker/htcondor/dask/labextension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
labextension:
factory:
module: 'dask_remote_jobqueue'
class: 'RemoteHTCondor'
args: []
kwargs: {}
default: {}
initial:
- name: "Initial Cluster"
29 changes: 29 additions & 0 deletions docker/htcondor/dask/spawn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Configure oidc-agent for user token management
echo "eval \`oidc-keychain\`" >> ~/.bashrc
eval `OIDC_CONFIG_DIR=$HOME/.config/oidc-agent oidc-keychain`
oidc-gen infncloud --issuer $IAM_SERVER \
--client-id $IAM_CLIENT_ID \
--client-secret $IAM_CLIENT_SECRET \
--rt $REFRESH_TOKEN \
--confirm-yes \
--scope "openid profile email" \
--redirect-uri http://localhost:8843 \
--pw-cmd "echo \"DUMMY PWD\""

kill `ps faux | grep "sts-wire ${USERNAME}" | awk '{ print $2 }'`
kill `ps faux | grep ".${USERNAME}" | awk '{ print $2 }'`
kill `ps faux | grep "sts-wire scratch" | awk '{ print $2 }'`
kill `ps faux | grep ".scratch" | awk '{ print $2 }'`

mkdir -p /s3/
mkdir -p /s3/${USERNAME}
mkdir -p /s3/scratch

cd /.init/

./sts-wire https://iam.cloud.infn.it/ ${USERNAME} https://minio.cloud.infn.it/ /${USERNAME} ../s3/${USERNAME} > .mount_log_${USERNAME}.txt &
./sts-wire https://iam.cloud.infn.it/ scratch https://minio.cloud.infn.it/ /scratch ../s3/scratch > .mount_log_scratch.txt &

source ~/htc.rc

0 comments on commit d452815

Please sign in to comment.