diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..c23f63e --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,30 @@ +name: Docker Image CI + +on: + release: + types: [released] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 +# - name: Login to Docker Hub +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build + uses: docker/build-push-action@v5 + with: +# push: true + context: . + platforms: linux/amd64,linux/arm64 + tags: alexanderrichards/dirac_ui:${{ github.event.release.tag_name }},alexanderrichards/dirac_ui:latest + build-args: | + dirac_version=${{ github.event.release.tag_name }} diff --git a/Dockerfile b/Dockerfile index 03306e4..8889f47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ -# syntax = docker/dockerfile:1.0-experimental +# syntax = docker/dockerfile:1 + FROM centos:7 -ARG dirac_version=7.3.26 +ARG dirac_version RUN mkdir /root/dirac_ui WORKDIR /root/dirac_ui @@ -9,11 +10,8 @@ RUN curl -LO https://github.com/DIRACGrid/DIRACOS2/releases/latest/download/DIRA RUN bash DIRACOS-Linux-$(uname -m).sh RUN rm DIRACOS-Linux-$(uname -m).sh RUN source diracos/diracosrc && pip install DIRAC==$dirac_version -RUN --mount=type=secret,id=proxy,dst=/tmp/x509up_u0 source diracos/diracosrc && dirac-configure -F -S GridPP -C dips://dirac01.grid.hep.ph.ic.ac.uk:9135/Configuration/Server -I WORKDIR /root COPY startup.sh /root/startup.sh CMD ["/bin/bash", "--init-file", "/root/startup.sh"] - - diff --git a/build.sh b/build.sh deleted file mode 100755 index 9970c29..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -DOCKER_BUILDKIT=1 docker build --no-cache --progress=plain --secret id=proxy,src=/tmp/x509up_u`id -u` --build-arg dirac_version="$1" --tag="alexanderrichards/dirac_ui:$1" . -DOCKER_BUILDKIT=1 docker build --progress=plain --secret id=proxy,src=/tmp/x509up_u`id -u` --build-arg dirac_version="$1" --tag="alexanderrichards/dirac_ui:latest" . diff --git a/build_env/Dockerfile b/build_env/Dockerfile deleted file mode 100644 index 4ae2d20..0000000 --- a/build_env/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM centos:7 - -# install Docker -RUN yum install -y yum-utils python3 -RUN yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo -RUN yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin - -#install Dirac UI -WORKDIR /root -RUN mkdir dirac_ui -WORKDIR /root/dirac_ui -RUN curl -LO https://github.com/DIRACGrid/DIRACOS2/releases/latest/download/DIRACOS-Linux-$(uname -m).sh -RUN bash DIRACOS-Linux-$(uname -m).sh -RUN rm DIRACOS-Linux-$(uname -m).sh -RUN source diracos/diracosrc && pip install DIRAC==7.3.26 - -COPY startup.sh /root/startup.sh -CMD ["/bin/bash", "--init-file", "/root/startup.sh"] diff --git a/build_env/build.sh b/build_env/build.sh deleted file mode 100644 index d5c50b6..0000000 --- a/build_env/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -docker build --tag dirac_build_env:latest . -docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /home/arichard/.globus:/root/.globus -v $(dirname $PWD):/root/build_dir dirac_build_env:latest -docker rmi dirac_build_env:latest \ No newline at end of file diff --git a/build_env/startup.sh b/build_env/startup.sh deleted file mode 100644 index dfa789d..0000000 --- a/build_env/startup.sh +++ /dev/null @@ -1,7 +0,0 @@ -source /root/dirac_ui/diracos/diracosrc -dirac-proxy-init -x -N -cd /root/build_dir -echo "*********************************************************" -echo "* Now build by typing: . build.sh *" -echo "*********************************************************" -echo "" diff --git a/startup.sh b/startup.sh index afaee07..b47c8e6 100644 --- a/startup.sh +++ b/startup.sh @@ -1,5 +1,15 @@ #!/bin/bash -read -p 'Creating grid proxy for which DIRAC group (i.e. _user): ' vo +read -p 'Enter setup name [GridPP]: ' setupname +read -p 'Enter configuration server URL [dips://dirac01.grid.hep.ph.ic.ac.uk:9135/Configuration/Server]: ' configurl +setupname=${setupname:-'GridPP'} +configurl=${configurl:-'dips://dirac01.grid.hep.ph.ic.ac.uk:9135/Configuration/Server'} . /root/dirac_ui/diracos/diracosrc +dirac-proxy-init -x -N +dirac-configure -F -S ${setupname} -C ${configurl} -I +echo "Configured OK." + +read -p 'Creating grid proxy for which DIRAC group (i.e. _user) [dirac_user]: ' vo +vo=${vo:-'dirac_user'} dirac-proxy-init -g $vo -M -U --Cert /root/.globus/usercert.pem --Key /root/.globus/userkey.pem +echo "proxy created OK."