Skip to content

Commit

Permalink
add github actions config
Browse files Browse the repository at this point in the history
  • Loading branch information
vvolkl committed Jun 9, 2020
1 parent 744f378 commit 9333c69
Show file tree
Hide file tree
Showing 18 changed files with 125 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/cred-helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec echo "$GITLAB_PASSWORD"
65 changes: 65 additions & 0 deletions .github/scripts/gitlabmirror.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

#set -u

DEFAULT_POLL_TIMEOUT=10
POLL_TIMEOUT=${POLL_TIMEOUT:-$DEFAULT_POLL_TIMEOUT}

echo ${GITHUB_REF}
# leave ancient history undisturbed
git fetch --shallow-since=01/01/2020

#github_ref
#git checkout "${GITHUB_REF}"

#branch=${GITHUB_REPOSITORY}/$(git symbolic-ref --short HEAD)
shortbranch=$(git symbolic-ref --short HEAD)

#git config --global credential.username $GITLAB_USERNAME
#git config --global core.askPass .github/scripts/cred-helper.sh
#git config --global credential.helper cache
#git remote add mirror $GITLAB_URL
#echo pushing to $shortbranch branch at $(git remote get-url --push mirror)
#git push mirror $shortbranch


# need a token with api acces
curl --silent --header "PRIVATE-TOKEN: ${GITLAB_PASSWORD2}" -X https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/mirror/pull

sleep $POLL_TIMEOUT


pipeline_id=$(curl --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/repository/commits/${shortbranch}" | jq '.last_pipeline.id')

echo "Triggered CI for branch ${shortbranch}"
echo "Working with pipeline id #${pipeline_id}"
echo "Poll timeout set to ${POLL_TIMEOUT}"

ci_status="pending"

until [[ "$ci_status" != "pending" && "$ci_status" != "running" ]]
do
sleep $POLL_TIMEOUT
ci_output=$(curl --silent "https://${GITLAB_HOSTNAME}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/${pipeline_id}")
ci_status=$(jq -n "$ci_output" | jq -r .status)
ci_web_url=$(jq -n "$ci_output" | jq -r .web_url)

echo "Current pipeline status: ${ci_status}"
if [ "$ci_status" = "running" ]
then
echo "Checking pipeline status..."
curl -d '{"state":"pending", "target_url": "'${ci_web_url}'", "context": "gitlab-ci"}' -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.antiope-preview+json" -X POST --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" > /dev/null
fi
done

echo "Pipeline finished with status ${ci_status}"

if [ "$ci_status" = "success" ]
then
curl -d '{"state":"success", "target_url": "'${ci_web_url}'", "context": "gitlab-ci"}' -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.antiope-preview+json" -X POST --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}"
exit 0
elif [ "$ci_status" = "failed" ]
then
curl -d '{"state":"failure", "target_url": "'${ci_web_url}'", "context": "gitlab-ci"}' -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.antiope-preview+json" -X POST --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}"
exit 1
fi
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Mirror and run GitLab CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Mirror + trigger CI
env:
GITLAB_URL: "https://gitlab.cern.ch/vavolkl/FCCSW"
GITLAB_HOSTNAME: "gitlab.cern.ch"
GITLAB_USERNAME: "vavolkl"
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
GITLAB_PASSWORD2: ${{ secrets.GITLAB_PASSWORD2 }}
GITLAB_PROJECT_ID: 93907
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POLL_TIMEOUT: 25
run: |
ls -alh
git status
./.github/scripts/gitlabmirror.sh
9 changes: 9 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# the git version on centos7 is too old for fetch
variables:
GIT_STRATEGY: clone

build-all:
script:
- source init.sh
- mkdir build; cd build; cmake ..; make -j `getconf _NPROCESSORS_ONLN`
- ctest -j `getconf _NPROCESSORS_ONLN`
2 changes: 1 addition & 1 deletion Examples/options/geant_fastsim_tklayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from GaudiKernel.SystemOfUnits import GeV, TeV
# create particle smearing tool, used for smearing in the tracker
smeartool = SimG4ParticleSmearRootFile("Smear")
smeartool.filename = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/tkLayout_example_resolutions.root"
smeartool.filename = "http://fccsw.web.cern.ch/fccsw/testsamples/tkLayout_example_resolutions.root"
## create region and a parametrisation model, pass smearing tool
regiontool = SimG4FastSimTrackerRegion("model", volumeNames=["TrackerEnvelopeBarrel"],
minMomentum = 5*GeV, maxMomentum = 10*TeV, maxEta=6, smearing=smeartool)
Expand Down
22 changes: 0 additions & 22 deletions Jenkinsfile

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ Common software for all FCC experiments.
This software is based on Gaudi.



Installation
------------


Log in to lxplus (CentOS7). Please note that these instructions might not work on another CentOS7 machine.

Clone your fork of this repository:
Expand All @@ -33,7 +35,7 @@ Test
----

~~~{.sh}
./run fccrun.py Examples/options/example_options.py
./run fccrun Examples/options/example_options.py
~~~

you can also specify some options like number of events and output file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
num_events = 3

#Geometry details to add noise to every Calo cell and paths to root files that have the noise const per cell
ecalBarrelNoisePath = "/eos/project/f/fccsw-web/testsamples/elecAndPileupNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
ecalBarrelNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/elecAndPileupNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
ecalBarrelNoiseHistName ="h_elecNoise_fcc_"
#active material identifier name
hcalIdentifierName = [ "module", "row", "layer" ]
Expand Down Expand Up @@ -179,12 +179,12 @@
createTopoInput.hcalFwdCells.Path = "emptyCaloCells"

readNeighboursMap =TopoCaloNeighbours("ReadNeighboursMap",
fileName = "/eos/project/f/fccsw-web/testsamples/calo/neighbours_map_barrel.root",
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/neighbours_map_barrel.root",
OutputLevel = DEBUG)

#Noise levels per cell
readNoisyCellsMap = TopoCaloNoisyCells("ReadNoisyCellsMap",
fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
OutputLevel = DEBUG)

createTopoClusters = CaloTopoCluster("CreateTopoClusters",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
num_events = 3

#Geometry details to add noise to every Calo cell and paths to root files that have the noise const per cell
ecalBarrelNoisePath = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth_noise.root"
ecalBarrelNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth_noise.root"
ecalBarrelNoiseHistName ="h_elecNoise_fcc_"
#active material identifier name
hcalIdentifierName = [ "module", "row", "layer" ]
Expand Down Expand Up @@ -187,13 +187,13 @@
createTopoInput.hcalFwdCells.Path = "emptyCaloCells"

readNeighboursMap =TopoCaloNeighbours("ReadNeighboursMap",
fileName = "/eos/project/f/fccsw-web/testsamples/calo/neighbours_map_barrel.root",
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/neighbours_map_barrel.root",
OutputLevel = DEBUG)

#Noise levels per cell
readNoisyCellsMap = TopoCaloNoisyCells("ReadNoisyCellsMap",
# fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
# fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
OutputLevel = DEBUG)

createTopoClusters = CaloTopoCluster("CreateTopoClusters",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@

readNeighboursMap =TopoCaloNeighbours("ReadNeighboursMap",
#fileName = "/afs/cern.ch/work/c/cneubuse/public/FCChh/neighbours_map_barrel.root",
fileName = "neighbours_map_fullGran_barrel.root", #/eos/project/f/fccsw-web/testsamples/calo/neighbours_map_barrel.root",
fileName = "neighbours_map_fullGran_barrel.root", #http://fccsw.web.cern.ch/fccsw/testsamples/calo/neighbours_map_barrel.root",
OutputLevel = DEBUG)

#Noise levels per cell
readNoisyCellsMap = TopoCaloNoisyCells("ReadNoisyCellsMap",
fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
# fileName = "/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_electronicsNoiseLevel.root",
# fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_segHcal_electronicsNoiseLevel.root",
OutputLevel = DEBUG)

createTopoClusters = CaloTopoCluster("CreateTopoClusters",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@
createTopoInput.hcalFwdCells.Path = "emptyCaloCells"

readNeighboursMap =TopoCaloNeighbours("ReadNeighboursMap",
fileName = "/eos/project/f/fccsw-web/testsamples/calo/neighbours_map_segHcal.root",
fileName = "http://fccsw.web.cern.ch/fccsw/testsamples/calo/neighbours_map_segHcal.root",
OutputLevel = DEBUG)

#Thresholds estimated from atlas, without noise !!!
readNoisyCellsMap = TopoCaloNoisyCells(
"ReadNoisyCellsMap",
fileName =
"/eos/project/f/fccsw-web/testsamples/calo/cellNoise_map_segHcal_constNoiseLevel.root",
"http://fccsw.web.cern.ch/fccsw/testsamples/calo/cellNoise_map_segHcal_constNoiseLevel.root",
OutputLevel = DEBUG)

createTopoClusters = CaloTopoCluster("CreateTopoClusters",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
calibcells = CalibrateCaloHitsTool("CalibrateCaloHitsTool", invSamplingFraction="5.4")
noise = NoiseCaloCellsFromFileTool("NoiseCaloCellsFromFileTool",
cellPositionsTool=dummyCells,
noiseFileName="root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/fcc_ecalCellNoise_mu1000_3radialLayers_v1.root")
noiseFileName="http://fccsw.web.cern.ch/fccsw/testsamples/fcc_ecalCellNoise_mu1000_3radialLayers_v1.root")

ecalgeo = TubeLayerPhiEtaCaloTool("EcalGeo",
readoutName = ecalReadoutName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
vertex = "GenVertices",
nPhiOptimFinal = [7]*8,
nEtaOptimFinal = [19]*8,
noiseFileName = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/elecNoise_pileup_cluster_mu200_700files.root")
noiseFileName = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_pileup_cluster_mu200_700files.root")

THistSvc().Output = ["rec DATAFILE='clusterCorrections_histograms.root' TYP='ROOT' OPT='RECREATE'"]
THistSvc().PrintAll=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from Configurables import FCCDataSvc
podioevent = FCCDataSvc("EventDataSvc")
# produced with Reconstruction/RecCalorimeter/tests/options/runFullCaloSystem_SimAndDigitisation.py
podioevent.input="root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/output_fullCalo_SimAndDigi_e50GeV_3events.root"
podioevent.input="http://fccsw.web.cern.ch/fccsw/testsamples/output_fullCalo_SimAndDigi_e50GeV_3events.root"
ApplicationMgr().ExtSvc += [podioevent]


Expand Down Expand Up @@ -174,7 +174,7 @@
from Configurables import NoiseCaloCellsFromFileTool
noiseBarrel = NoiseCaloCellsFromFileTool("NoiseBarrel")
noiseBarrel.readoutName = ecalBarrelReadoutName
noiseBarrel.noiseFileName = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
noiseBarrel.noiseFileName = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
noiseBarrel.elecNoiseHistoName = "h_elecNoise_fcc_"
noiseBarrel.activeFieldName = "layer"
noiseBarrel.addPileup = False
Expand Down Expand Up @@ -206,7 +206,7 @@
from Configurables import NoiseCaloCellsFromFileTool
noiseEndcap = NoiseCaloCellsFromFileTool("NoiseEndcap")
noiseEndcap.readoutName = ecalEndcapReadoutName
noiseEndcap.noiseFileName = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/elecNoise_emec_50Ohm_2shieldWidth_6layers.root"
noiseEndcap.noiseFileName = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_emec_50Ohm_2shieldWidth_6layers.root"
noiseEndcap.elecNoiseHistoName = "h_elecNoise_fcc_"
noiseEndcap.activeFieldName = "layer"
noiseEndcap.addPileup = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
OutputLevel = WARNING)


ecalBarrelNoisePath = "/eos/project/f/fccsw-web/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
ecalEndcapNoisePath = "/eos/project/f/fccsw-web/testsamples/elecNoise_emec_50Ohm_2shieldWidth_6layers.root"
ecalBarrelNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_ecalBarrel_50Ohm_traces2_2shieldWidth.root"
ecalEndcapNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_emec_50Ohm_2shieldWidth_6layers.root"
ecalBarrelNoiseHistName = "h_elecNoise_fcc_"
ecalEndcapNoiseHistName = "h_elecNoise_fcc_"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

# v01 production - min. bias events
podioevent = FCCDataSvc("EventDataSvc", input="/eos/project/f/fccsw-web/testsamples/caloCells_minBiasEvent.root")
podioevent = FCCDataSvc("EventDataSvc", input="http://fccsw.web.cern.ch/fccsw/testsamples/caloCells_minBiasEvent.root")

# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import PodioInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
geoservice.OutputLevel = WARNING


ecalBarrelNoisePath = "root://eosuser.cern.ch//eos/project/f/fccsw-web/testsamples/elecNoise_ecalBarrelFCCee_50Ohm_traces1_4shieldWidth.root"
ecalBarrelNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/elecNoise_ecalBarrelFCCee_50Ohm_traces1_4shieldWidth.root"
ecalEndcapNoisePath = "elecNoise_emec_50Ohm_2shieldWidth_6layers.root"
ecalBarrelNoiseHistName = "h_elecNoise_fcc_"
ecalEndcapNoiseHistName = "h_elecNoise_fcc_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
hcalBarrelReadoutName = "BarHCal_Readout_phieta"
# noise files
# has HCal electr. noise levels as well as ECal electr. noise level
BarrelNoisePath = "/eos/project/f/fccsw-web/testsamples/noiseBarrel_PU200.root"
BarrelNoisePath = "http://fccsw.web.cern.ch/fccsw/testsamples/noiseBarrel_PU200.root"
ecalBarrelNoiseHistName = "h_elecNoise_fcc_"
hcalBarrelNoiseHistName = "h_elec_hcal_layer"

Expand Down

0 comments on commit 9333c69

Please sign in to comment.