Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .Jenkins/workflows/Jenkinsfile_EL9
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pipeline {
}
}
}
stage('rpmbuild') {
stage('build_whl') {
agent {
node {
label 'podman'
Expand All @@ -117,7 +117,7 @@ pipeline {
steps {
script {
// DOCKER_IMAGE is defined through Jenkins project
rpmbuildStageDockerImage="${DOCKER_IMAGE}_${BUILD_NUMBER}_${STAGE_NAME}"
buildwhlStageDockerImage="${DOCKER_IMAGE}_${BUILD_NUMBER}_${STAGE_NAME}"
}
echo "cleanup workspace"
sh 'for f in $(ls -A); do rm -rf ${f}; done'
Expand All @@ -135,16 +135,16 @@ pipeline {
fi
cd ..
'''
echo "prepare podman image ${rpmbuildStageDockerImage}"
sh "podman build --pull --tag ${rpmbuildStageDockerImage} --build-arg BASEIMAGE=docker.io/hepcloud/decision-engine-ci-el9:${BRANCH} --build-arg UID=\$(id -u) --build-arg GID=\$(id -g) -f decisionengine_modules/package/ci/EL9/Dockerfile decisionengine_modules/package/ci/EL9/"
echo "prepare podman image ${buildwhlStageDockerImage}"
sh "podman build --pull --tag ${buildwhlStageDockerImage} --build-arg BASEIMAGE=hepcloud/decision-engine-ci-el9:${BRANCH} --build-arg UID=\$(id -u) --build-arg GID=\$(id -g) -f decisionengine_modules/package/ci/EL9/Dockerfile decisionengine_modules/package/ci/EL9/"
echo "Run ${STAGE_NAME} tests"
sh "podman run --userns keep-id:uid=\$(id -u),gid=\$(id -g) --rm --env GITHUB_PR_NUMBER=${GITHUB_PR_NUMBER} --env PYTEST_TIMEOUT=${PYTEST_TIMEOUT} -v ${WORKSPACE}/decisionengine_modules:${WORKSPACE}/decisionengine_modules -w ${WORKSPACE}/decisionengine_modules ${rpmbuildStageDockerImage} \"setup.py bdist_rpm\" \"rpmbuild.log\" \"${BRANCH}\""
sh "podman run --userns keep-id:uid=\$(id -u),gid=\$(id -g) --rm --env GITHUB_PR_NUMBER=${GITHUB_PR_NUMBER} --env PYTEST_TIMEOUT=${PYTEST_TIMEOUT} -v ${WORKSPACE}/decisionengine_modules:${WORKSPACE}/decisionengine_modules -w ${WORKSPACE}/decisionengine_modules ${buildwhlStageDockerImage} \"setup.py bdist_wheel\" \"build_whl.log\" \"${BRANCH}\""
}
post {
always {
archiveArtifacts artifacts: "decisionengine_modules/rpmbuild.log,decisionengine_modules/dist/*.rpm"
echo "cleanup podman image ${rpmbuildStageDockerImage}"
sh "podman rmi ${rpmbuildStageDockerImage}"
archiveArtifacts artifacts: "decisionengine_modules/build_whl.log,decisionengine_modules/dist/*.whl"
echo "cleanup podman image ${buildwhlStageDockerImage}"
sh "podman rmi ${buildwhlStageDockerImage}"
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions .github/actions/python-command-in-el9-container/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0

name: "Python Action"
description: "Run python3 action in preconfigured EL9 container image"
inputs:
python-command:
description: "What to run"
required: true
default: "-m pytest"
logfile:
description: "Where to log output"
required: true
default: "pytest.log"
runs:
using: "docker"
image: "../../../package/ci/EL9/Dockerfile"
args:
- ${{ inputs.python-command }}
- ${{ inputs.logfile }}
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,42 @@ jobs:
run: |
cd doc
make rst html latexpdf

build_whl:
if: ${{ github.ref != 'refs/heads/1.7' }}
name: Build DE Modules whl
runs-on: ubuntu-latest
needs: pytest
steps:
- name: make date tag
id: mkdatetag
run: echo "::set-output name=dtag::$(date +%Y%m%d_%H%M%S)"

- name: make ref tag case 1
id: mkreftag1
if: ${{ github.event.inputs.ref != '' }}
run: echo "::set-output name=reftag::${{github.event.inputs.ref}}"

- name: make ref tag case 2
id: mkreftag2
if: ${{ github.event.inputs.ref == '' }}
run: echo "::set-output name=reftag::${GITHUB_BASE_REF:+PR}"$(awk -F"/" '{print $3}' <<< ${GITHUB_REF})

- name: checkout code tree
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{github.event.inputs.ref}}

- name: Run the build in a container (EL9/HEPCloud-CI)
uses: ./.github/actions/python-command-in-el9-container
with:
python-command: "setup.py bdist_wheel"
logfile: "build_whl.log"

- name: Archive whl
uses: actions/upload-artifact@v3
with:
name: whl-DE-EL9-${{steps.mkreftag1.outputs.reftag}}${{steps.mkreftag2.outputs.reftag}}-${{steps.mkdatetag.outputs.dtag}}
path: dist/*.whl
if-no-files-found: error
2 changes: 1 addition & 1 deletion package/ci/EL9/python3-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ git clone -b ${DE_BRANCH} https://github.com/HEPCloud/decisionengine.git

# checkout GlideinWMS for python3
rm -rf glideinwms
git clone -b branch_v3_9 https://github.com/glideinWMS/glideinwms.git
git clone -b master https://github.com/glideinWMS/glideinwms.git

# Install dependencies for GlideinWMS
python3 -m pip install --upgrade pip
Expand Down
16 changes: 15 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,27 @@
]
rpm_require.extend(__base_pip_requires)


# This metadata can be read out with:
# import importlib.metadata
# dir(importlib.metadata.metadata('decisionengine_modules'))
# or
# importlib_resources on python < 3.9
#
# Much of it comes out of decisionengine_modules.about.py

# for decisionengine dev we have version in the form X.Y.Z.devN
# while for tag we have version in the form X.Y.Z
verarr = about.__version__.split(".")[:4]
if len(verarr) > 3:
# this is a dev version
ver = ".".join(verarr[:3] + [verarr[3][:3]])
else:
# this is a tag
ver = ".".join(verarr[:3])
# string to add decisionengine as decisionengine_modules requirement
de_req = [f"decisionengine>=" + ver]

setup(
setup_requires=["setuptools >= 51.2", "wheel >= 0.36.2", "setuptools_scm >= 6.3.1"],
python_requires=">3.7.0",
Expand All @@ -89,7 +103,7 @@
license=about.__license__,
package_dir={"": "src"},
packages=find_packages(where="src", exclude=("tests", "*.tests", "*.tests.*", "build.*", "doc.*")),
install_requires=runtime_require,
install_requires=runtime_require + de_req,
extras_require={
"develop": devel_req,
},
Expand Down
Loading