-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (95 loc) · 3.28 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: ci
on:
push:
branches:
- "master"
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile-BPP
build-args: |
CondaFile=environment.yaml
#push: true
push: false
tags: psi4/psi4:latest,psi4/psi4:1.8.0,psi4/psi4:1.8
#tags: ${{ secrets.DOCKERHUB_USERNAME }}/psi4:latest
-
name: List
if: false
run: |
docker run ${{ secrets.DOCKERHUB_USERNAME }}/clockbox:latest micromamba list --json
-
name: Test
run: |
docker run ${{ secrets.DOCKERHUB_USERNAME }}/psi4:latest psi4 --version
docker run ${{ secrets.DOCKERHUB_USERNAME }}/psi4:latest pytest -v /opt/conda/lib/python3.10/site-packages/psi4/tests/ --color yes -n auto -m smoke
-
name: Set up Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.1.2
-
name: Run an apptainer container
#run: apptainer run docker://alpine cat /etc/os-release
run: apptainer build psi4-1.8.sif docker-daemon:${{ secrets.DOCKERHUB_USERNAME }}/psi4:latest
-
name: Test Apptainer
run: |
apptainer run psi4-1.8.sif psi4 --version
apptainer run psi4-1.8.sif pytest -v /opt/conda/lib/python3.10/site-packages/psi4/tests/ --color yes -n auto -m smoke
-
name: Archive Apptainer Image
#if: ${{ github.repository == 'psi4/psi4' }}
uses: actions/upload-artifact@v2
with:
name: apptainer_sif
path: |
psi4-1.8.sif
retention-days: 1
-
name: Push to Sylabs
if: false
run: apptainer push psi4-1.8.sif library://psi4/psi4/psi4-1.8:latest
#$ singularity push my-container.sif library://your-name/project-dir/my-container:latest
#singularity push my-container.sif library://your-name/project-dir/my-container:latest
#singularity push -U image.sif library://your-username/project-dir/my-container:tags
#apptainer push /home/user/my.sif library://user/collection/my.sif:latest
# #!/bin/bash
# set -eu
# CONDA_FILE="${1}"
# FILE_BASE="${1//.yaml/}"
# PROGRAM="${FILE_BASE//_*/}"
# VERSION="${FILE_BASE//*_/}"
# MANIFEST="${FILE_BASE}.manifest"
# DOCKER_TAG="${PROGRAM}:${VERSION}"
# if [[ ! -f "${CONDA_FILE}" ]]
# then
# echo "File ${CONDA_FILE} does not exist or is not a file"
# exit 1
# fi
# echo "--------------------------------------------------------"
# echo "Conda file: ${CONDA_FILE}"
# echo "Program: ${PROGRAM}"
# echo "Version: ${VERSION}"
# echo "--------------------------------------------------------"
# docker build . --build-arg CondaFile="${CONDA_FILE}" -t "${DOCKER_TAG}"
# docker run ${DOCKER_TAG} micromamba list --json > "${MANIFEST}"
# apptainer build ${FILE_BASE}.sif docker-daemon:${DOCKER_TAG}