Skip to content

Commit

Permalink
test docker auto build
Browse files Browse the repository at this point in the history
  • Loading branch information
YanzhaoW committed Jan 6, 2025
1 parent ca1b4b4 commit 146fbdf
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/container_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: deploy-container

on:
push:
branches: [ neuland_new_calibration ]
workflow_dispatch:


jobs:
setup:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'

# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ vars.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# push: true
# context: util/container
# tags: ${{ vars.DOCKER_USERNAME }}/r3bdev:test

- name: build apptainer
run: |
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt-get update
sudo apt-get install -y apptainer
apptainer remote add --no-login SylabsCloud cloud.sycloud.io
echo "${{ secrets.SYLABS_TOKEN }}" | apptainer remote login SylabsCloud
set -e
apptainer delete -F library://${{ vars.SYLABS_USERNAME }}/r3bdev/r3broot:test || true
sudo apptainer build --notest test.sif ./util/container/test.def
apptainer push -D "For testing" -U test.sif library://${{ vars.SYLABS_USERNAME }}/r3bdev/r3broot:test
shell: bash
28 changes: 28 additions & 0 deletions util/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM yanzhaowang/r3bdev:fedora41

ENV FAIRROOTPATH="/root/FairRoot"
ENV UCESB_DIR="/root/ucesb"
ENV PEDEDIR="/root"
ENV THREAD_NUM=4
ENV R3B_BRNAME="neuland_new_calibration"

RUN yes | dnf upgrade --refresh

# RUN yes | dnf upgrade --refresh &&\
# dnf install -y byacc && pip install conan --upgrade &&\
# mkdir -p $FAIRROOTPATH &&\
# cd /tmp &&\
# git clone --depth 1 --branch dev https://github.com/FairRootGroup/FairRoot.git &&\
# cd FairRoot &&\
# mkdir build && cd build && cmake -GNinja -DCMAKE_INSTALL_PREFIX=${FAIRROOTPATH} .. &&\
# ninja -j${THREAD_NUM} && ninja install &&\
# cd /root && git clone https://git.chalmers.se/expsubphys/ucesb.git && cd ucesb && make empty/empty &&\
# cd /root &&\
# git clone --depth 1 --branch ${R3B_BRNAME} https://github.com/YanzhaoW/R3BRoot.git &&\
# cd R3BRoot && git submodule update --init && cmake --preset default -GNinja &&\
# cmake --build --preset default -- -j${THREAD_NUM} &&\
# source build/config.sh && root -l -q neuland/geobase/create_neuland_geo.C &&\
# rm -rf /tmp/FairRoot

# ENV CONFIG_FILE="/root/R3BRoot/build/config.sh"
# ENTRYPOINT ["/bin/bash", "--rcfile", "/root/R3BRoot/build/config.sh"]
8 changes: 8 additions & 0 deletions util/container/neuland.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BootStrap: docker
From: yanzhaowang/r3bdev:r3broot

%environment
source /root/R3BRoot/build/config.sh

%runscript
neulandSim $@
6 changes: 6 additions & 0 deletions util/container/test.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BootStrap: docker
From: yanzhaowang/r3bdev:test

%runscript
echo "$@"

0 comments on commit 146fbdf

Please sign in to comment.