Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key4hep bot patch 2 #6

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions .github/scripts/post_pr_comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ generate_post_data()
EOF
}
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo "github ref:" $GITHUB_REF
echo "pr number:" $PR_NUMBER
echo "PR number" "${PR_NUMBER2}"
echo "PR number" "${PR_NUMBER}"
echo "github_repository:" "$GITHUB_REPOSITORY"

PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
echo PR_NUMBER
#PR_NUMBER="${PR_NUMBER2}"
curl -s -H "Authorization: token ${KEY4HEP_COMMENT_BOT_TOKEN}" \
-X POST -d "$(generate_post_data)" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments"
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/concretize-lxplus-pr-target.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: concretize-lxplus-comment-bot
on: [pull_request_target]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check if workflow should be run
run: |
ismember=$(curl \
-o /dev/null --silent --head \
-H "Authorization: token ${{ secrets.COMMENT_TOKEN }}" \
--write-out '%{http_code}\n' \
https://api.github.com/orgs/key4hep/members/vvolkl\
)
if [ "$ismember" = 204 ]
then
echo ""
else
exit 1
fi
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: cvmfs-contrib/github-action-cvmfs@v2
with:
cvmfs_repositories: 'sw.hsf.org,sw-nightlies.hsf.org,sft-nightlies.cern.ch,sft.cern.ch,geant4.cern.ch'
- name: Start container
run: |
docker run -it --name CI_container -e GITHUB_ENV=${GITHUB_ENV} -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d clicdp/cc7-lcg /bin/bash
- name: Setup container
run: |
docker exec CI_container /bin/bash -c ' ln -s /usr/lib64/liblzma.so.5.2.2 /usr/lib64/liblzma.so;'
- name: Setup Spack
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
source scripts/ci_setup_spack2.sh;'
- name: Concretize
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
source spack/share/spack/setup-env.sh;\
spack spec -I key4hep-stack | tee -a key4hep-stack-concretization.log;'
- name: Comment PR
env:
KEY4HEP_COMMENT_BOT_TOKEN: ${{ secrets.KEY4HEP_COMMENT_BOT_TOKEN }}
run: |
${GITHUB_WORKSPACE}/.github/scripts/generate_pr_comment.sh
${GITHUB_WORKSPACE}/.github/scripts/post_pr_comment.sh
12 changes: 5 additions & 7 deletions .github/workflows/concretize-lxplus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ jobs:
docker exec CI_container /bin/bash -c 'cd ./Package;\
source spack/share/spack/setup-env.sh;\
spack spec -I key4hep-stack | tee -a key4hep-stack-concretization.log;'
- name: Comment PR
if: github.event_name == 'pull_request'
env:
KEY4HEP_COMMENT_BOT_TOKEN: ${{ secrets.KEY4HEP_COMMENT_BOT_TOKEN }}
run: |
${GITHUB_WORKSPACE}/.github/scripts/generate_pr_comment.sh
${GITHUB_WORKSPACE}/.github/scripts/post_pr_comment.sh
- uses: actions/upload-artifact@v2
with:
name: concretization-log-artifact
path: key4hep-stack-concretization.log
retention-days: 5
14 changes: 14 additions & 0 deletions config/compilers_centos7_cvmfs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
compilers:
- compiler:
paths:
cc: /cvmfs/sw.hsf.org/spackages/linux-centos7-haswell/gcc-4.8.5/gcc-8.3.0-avsmzt7bekq7ispf6zlarx6vwdretbae/bin/gcc
cxx: /cvmfs/sw.hsf.org/spackages/linux-centos7-haswell/gcc-4.8.5/gcc-8.3.0-avsmzt7bekq7ispf6zlarx6vwdretbae/bin/g++
f77: /cvmfs/sw.hsf.org/spackages/linux-centos7-haswell/gcc-4.8.5/gcc-8.3.0-avsmzt7bekq7ispf6zlarx6vwdretbae/bin/gfortran
fc: /cvmfs/sw.hsf.org/spackages/linux-centos7-haswell/gcc-4.8.5/gcc-8.3.0-avsmzt7bekq7ispf6zlarx6vwdretbae/bin/gfortran
operating_system: centos7
target: x86_64
modules: []
environment: {}
extra_rpaths: []
flags: {}
spec: [email protected]
2 changes: 1 addition & 1 deletion config/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
packages:
all:
target: [broadwell]
variants: build_type=Release
variants: build_type=Debug
buildable: true
version: []
providers:
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_setup_spack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
echo ' - $SPACK_ROOT/var/spack/repos/key4hep-spack' >> spack/etc/spack/repos.yaml
tar -czf key4hep-spack.tar.gz spack
cp ${PWD}/spack/var/spack/repos/key4hep-spack/config/cvmfs_build/upstreams.yaml spack/etc/spack/
# compiler setup
compiler setup
spack load gcc
spack compiler find --scope site
tar -czf key4hep-spack_centos7-cvmfs.tar.gz spack
20 changes: 20 additions & 0 deletions scripts/ci_setup_spack2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# set up spack inside the k4-spack repo
if [ -n "$SPACK_VERSION" ]; then git clone https://github.com/key4hep/spack ; cd spack; git checkout $SPACK_VERSION; cd ..; else git clone --depth 1 https://github.com/key4hep/spack; fi
source spack/share/spack/setup-env.sh
# get the right config files to the right places
cp config/packages.yaml spack/etc/spack/
mkdir spack/var/spack/repos/key4hep-spack
cp -r * spack/var/spack/repos/key4hep-spack || true
# clean up git directories for zip
rm -rf spack/var/spack/repos/key4hep-spack/spack || true
rm -rf spack/.git
# register k4 package recipes with spack
echo "repos:" > spack/etc/spack/repos.yaml
echo ' - $SPACK_ROOT/var/spack/repos/key4hep-spack' >> spack/etc/spack/repos.yaml
tar -czf key4hep-spack.tar.gz spack
cp ${PWD}/spack/var/spack/repos/key4hep-spack/config/cvmfs_build/upstreams.yaml spack/etc/spack/
cp config/compilers_centos7_cvmfs.yaml spack/etc/spack/compilers.yaml
# compiler setup
# spack load gcc
# spack compiler find --scope site
# tar -czf key4hep-spack_centos7-cvmfs.tar.gz spack