Skip to content

Commit b830754

Browse files
committed
test: gubbins
1 parent 0b35072 commit b830754

File tree

3 files changed

+11
-168
lines changed

3 files changed

+11
-168
lines changed

.github/workflows/deployment.yml

Lines changed: 3 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,15 @@ jobs:
1818
deploy-pypi:
1919
name: PyPI deployment
2020
runs-on: "ubuntu-latest"
21-
if: github.event_name != 'push' || github.repository == 'DIRACGrid/diracx'
21+
if: github.event_name != 'push' || github.repository == 'aldbr/diracx'
2222
outputs:
23-
new-version: ${{ steps.check-tag.outputs.new-version }}
2423
create-release: ${{ steps.check-tag.outputs.create-release }}
25-
permissions:
26-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing on pypi
27-
actions: write
28-
checks: write
29-
contents: write
30-
deployments: write
31-
discussions: write
32-
issues: write
33-
packages: write
34-
pages: write
35-
pull-requests: write
36-
repository-projects: write
37-
security-events: write
38-
statuses: write
3924
defaults:
4025
run:
4126
# We need extglob for REFERENCE_BRANCH substitution
4227
shell: bash -l -O extglob {0}
4328
steps:
4429
- uses: actions/checkout@v4
45-
with:
46-
token: ${{ github.token }}
47-
- run: |
48-
git fetch --prune --unshallow
49-
git config --global user.email "[email protected]"
50-
git config --global user.name "DIRACGrid CI"
5130
- uses: actions/setup-python@v5
5231
with:
5332
python-version: '3.11'
@@ -60,60 +39,14 @@ jobs:
6039
readme_renderer[md] \
6140
requests \
6241
setuptools_scm
63-
- name: Validate README for PyPI
64-
run: |
65-
python -m readme_renderer README.md -o /tmp/README.html
66-
- name: Prepare release notes
67-
run: |
68-
set -xeuo pipefail
69-
IFS=$'\n\t'
70-
# Needed for the advanced pattern matching used in REFERENCE_BRANCH
71-
PREV_VERSION=$(git describe --tags --abbrev=0)
72-
# In case of manual trigger,
73-
# GITHUB_REF is of the form refs/heads/main -> we want main
74-
# In case of PR it is of the form refs/pull/59/merge -> we want pull/59/merge
75-
REFERENCE_BRANCH=${GITHUB_REF##refs*(/heads)/}
76-
echo "Making release notes for ${REFERENCE_BRANCH} since ${PREV_VERSION}"
77-
(git log ${PREV_VERSION}...${REFERENCE_BRANCH} --oneline --no-merges --) > release.notes.new
78-
cat release.notes.new
7942
- name: Create tag if required
8043
id: check-tag
8144
run: |
8245
set -xeuo pipefail
8346
IFS=$'\n\t'
8447
# Only do a real release for workflow_dispatch events
8548
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
86-
echo "Will create a real release"
87-
export NEW_VERSION="v${{ github.event.inputs.version }}"
88-
if [[ "${NEW_VERSION}" == "v" ]]; then
89-
# If version wasn't given as an input to the workflow, use setuptools_scm to guess while removing "dev" portion of the version number
90-
NEW_VERSION=v$(python -m setuptools_scm | sed 's@Guessed Version @@g' | sed -E 's@(\.dev|\+g).+@@g')
91-
export NEW_VERSION
92-
fi
93-
echo "Release will be named $NEW_VERSION"
94-
# Validate the version
95-
# Ensure the version doesn't look like a PEP-440 "dev release" (which might happen if the automatic version bump has issues)
96-
python -c $'from packaging.version import Version; v = Version('"'$NEW_VERSION'"$')\nif v.is_devrelease:\n raise ValueError(v)'
97-
# Make sure we always only create pre-releases
98-
python -c $'from packaging.version import Version; v = Version('"'$NEW_VERSION'"$')\nif not v.is_prerelease:\n raise ValueError("integration should only be used for pre-releases")'
99-
# Commit the release notes
100-
mv release.notes release.notes.old
101-
cat release.notes.old
102-
(echo -e "[${NEW_VERSION}]" && cat release.notes.new release.notes.old) > release.notes
103-
###################3
104-
# TODO: we should add the release notes somewhere at some point
105-
# now we just don't do it because main branch is protected
106-
# and we can't push directly from the CI
107-
#git add release.notes
108-
#git commit -m "docs: Add release notes for $NEW_VERSION"
109-
# Stash is mandatory not to leave the repo dirty
110-
git stash
111-
########################
112-
git show
113-
# Create the tag
114-
git tag "$NEW_VERSION"
11549
echo "create-release=true" >> $GITHUB_OUTPUT
116-
echo "new-version=$NEW_VERSION" >> $GITHUB_OUTPUT
11750
fi
11851
- name: Build distributions
11952
run: |
@@ -129,96 +62,6 @@ jobs:
12962
name: diracx-whl
13063
path: dist/diracx*.whl
13164
retention-days: 5
132-
- name: Make release on GitHub
133-
if: steps.check-tag.outputs.create-release == 'true'
134-
run: |
135-
set -e
136-
export NEW_VERSION=${{ steps.check-tag.outputs.new-version }}
137-
REFERENCE_BRANCH=${GITHUB_REF##refs*(/heads)/}
138-
echo "Pushing tagged release notes to ${REFERENCE_BRANCH}"
139-
git push "origin" "${REFERENCE_BRANCH}"
140-
echo "Making GitHub release for ${NEW_VERSION}"
141-
.github/workflows/make_release.py \
142-
--repo="${{ github.repository }}" \
143-
--token="${{ secrets.GITHUB_TOKEN }}" \
144-
--version="${NEW_VERSION}" \
145-
--rev="$(git rev-parse HEAD)" \
146-
--release-notes-fn="release.notes.new"
147-
# Use trusted publisher for pypi
148-
# https://docs.pypi.org/trusted-publishers/
149-
- name: Publish package on PyPI
150-
if: steps.check-tag.outputs.create-release == 'true'
151-
uses: pypa/gh-action-pypi-publish@release/v1
152-
153-
docker:
154-
needs: deploy-pypi
155-
timeout-minutes: 30
156-
runs-on: ubuntu-latest
157-
steps:
158-
- name: Checkout
159-
uses: actions/checkout@v4
160-
- name: Set up QEMU
161-
uses: docker/setup-qemu-action@v3
162-
- name: Set up Docker Buildx
163-
uses: docker/setup-buildx-action@v3
164-
- name: Login to GitHub container registry
165-
uses: docker/login-action@v3
166-
with:
167-
registry: ghcr.io
168-
username: ${{ github.actor }}
169-
password: ${{ secrets.GITHUB_TOKEN }}
170-
- name: Download diracx wheels
171-
uses: actions/download-artifact@v4
172-
with:
173-
name: diracx-whl
174-
- name: "Find wheels"
175-
id: find_wheel
176-
run: |
177-
# We need to copy them there to be able to access them in the RUN --mount
178-
cp diracx*.whl containers/client/
179-
cp diracx*.whl containers/services/
180-
for wheel_fn in *.whl; do
181-
pkg_name=$(basename "${wheel_fn}" | cut -d '-' -f 1)
182-
echo "${pkg_name}-wheel-name=$(ls "${pkg_name}"-*.whl)" >> $GITHUB_OUTPUT
183-
done
184-
185-
- name: Build and push client (release)
186-
uses: docker/build-push-action@v6
187-
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
188-
with:
189-
context: containers/client/
190-
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
191-
tags: "ghcr.io/diracgrid/diracx/client:${{ needs.deploy-pypi.outputs.new-version }}"
192-
platforms: linux/amd64,linux/arm64
193-
build-args: EXTRA_PACKAGES_TO_INSTALL=DIRAC~=9.0.0a1
194-
- name: Build and push services (release)
195-
uses: docker/build-push-action@v6
196-
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
197-
with:
198-
context: containers/services/
199-
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
200-
tags: "ghcr.io/diracgrid/diracx/services:${{ needs.deploy-pypi.outputs.new-version }}"
201-
platforms: linux/amd64,linux/arm64
202-
build-args: EXTRA_PACKAGES_TO_INSTALL=DIRAC~=9.0.0a1
203-
204-
- name: Build and push client (dev)
205-
uses: docker/build-push-action@v6
206-
with:
207-
context: containers/client/
208-
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
209-
tags: ghcr.io/diracgrid/diracx/client:dev
210-
platforms: linux/amd64,linux/arm64
211-
build-args: |
212-
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
213-
- name: Build and push services (dev)
214-
uses: docker/build-push-action@v6
215-
with:
216-
context: containers/services/
217-
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
218-
tags: ghcr.io/diracgrid/diracx/services:dev
219-
platforms: linux/amd64,linux/arm64
220-
build-args: |
221-
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
22265

22366
# -------------------------------------------------------------------------------------------------
22467
# Gubbins deployment
@@ -313,14 +156,14 @@ jobs:
313156
with:
314157
context: extensions/containers/client
315158
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
316-
tags: ghcr.io/diracgrid/gubbins/client:dev
159+
tags: ghcr.io/aldbr/gubbins/client:dev
317160
platforms: linux/amd64,linux/arm64
318161
- name: Build and push service (dev)
319162
uses: docker/build-push-action@v6
320163
with:
321164
context: extensions/containers/services
322165
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
323-
tags: ghcr.io/diracgrid/gubbins/services:dev
166+
tags: ghcr.io/aldbr/gubbins/services:dev
324167
platforms: linux/amd64,linux/arm64
325168
build-args: |
326169
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration

.github/workflows/extensions.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Extensions full test
33
on:
44
push:
55
branches:
6-
- main
6+
- main_FEAT_deploy-gubbins-test
77
pull_request:
88
branches:
9-
- main
9+
- main_FEAT_deploy-gubbins-test
1010

1111

1212
defaults:
@@ -71,7 +71,7 @@ jobs:
7171
build-wheels:
7272
name: Build wheels
7373
runs-on: "ubuntu-latest"
74-
if: github.event_name != 'push' || github.repository == 'DIRACGrid/diracx'
74+
if: github.event_name != 'push' || github.repository == 'aldbr/diracx'
7575
defaults:
7676
run:
7777
# We need extglob for REFERENCE_BRANCH substitution
@@ -152,17 +152,17 @@ jobs:
152152
uses: docker/build-push-action@v6
153153
with:
154154
context: extensions/containers/services
155-
tags: ghcr.io/diracgrid/gubbins/services:dev
156-
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
155+
tags: ghcr.io/aldbr/gubbins/services:dev
156+
push: ${{ github.event_name != 'pull_request' && github.repository == 'aldbr/diracx' && github.ref_name == 'main_FEAT_deploy-gubbins-test' }}
157157
build-args: |
158158
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
159159
EXTENSION_CUSTOM_SOURCES_TO_INSTALL=/bindmount/gubbins_db*.whl,/bindmount/gubbins_logic*.whl,/bindmount/gubbins_routers*.whl,/bindmount/gubbins_client*.whl
160160
- name: Build and export client
161161
uses: docker/build-push-action@v6
162162
with:
163163
context: extensions/containers/client
164-
tags: ghcr.io/diracgrid/gubbins/client:dev
165-
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
164+
tags: ghcr.io/aldbr/gubbins/client:dev
165+
push: ${{ github.event_name != 'pull_request' && github.repository == 'aldbr/diracx' && github.ref_name == 'main_FEAT_deploy-gubbins-test' }}
166166

167167
pytest-integration:
168168
needs: build-image

extensions/gubbins_values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ global:
33
imagePullPolicy: Always
44
images:
55
tag: dev
6-
services: ghcr.io/diracgrid/gubbins/services
6+
services: ghcr.io/aldbr/gubbins/services
77

88
developer:
99
enabled: true

0 commit comments

Comments
 (0)