Skip to content
Merged
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
46 changes: 46 additions & 0 deletions .github/workflows/docker_images_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Reusable workflow to setup a specific WMCore component for pip

on:
workflow_call:
inputs:
wmcore_component:
required: true
type: string

jobs:
build_images_from_template:
runs-on: ubuntu-latest
steps:
- name: Get the Ref
id: get-ref
uses: ankitvgupta/ref-to-tag-action@master
with:
ref: ${{ github.ref }}
head_ref: ${{ github.head_ref }}

- name: Build image
run: |
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/pypi/${{inputs.wmcore_component}}/Dockerfile
sed -i -e "s,ENV TAG=.*,ENV TAG=${{steps.get-ref.outputs.tag}},g" Dockerfile
cat Dockerfile
docker build --tag registry.cern.ch/cmsweb/${{inputs.wmcore_component}}:${{steps.get-ref.outputs.tag}} .

- name: Images
run: |
docker images

- name: Login to registry.cern.ch
uses: docker/login-action@v2
with:
registry: registry.cern.ch
username: ${{ secrets.CERN_LOGIN }}
password: ${{ secrets.CERN_TOKEN }}

- name: Publish image to registry.cern.ch
uses: docker/build-push-action@v1
with:
registry: registry.cern.ch
username: ${{ secrets.CERN_LOGIN }}
password: ${{ secrets.CERN_TOKEN }}
repository: cmsweb/${{inputs.wmcore_component}}
tag_with_ref: true
51 changes: 51 additions & 0 deletions .github/workflows/pypi_build_and_images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow will build and upload WMCore core services to the production PyPI
# based on tag releases, see build_and_publish_services job. Then, the second
# named build_images, will build appropriate docker images using CMSKubernetes
# Dockefiles and upload them to CERN registry.
#
# The build_and_publish_services job relies on pypi_build_template.yaml
# The build_images relies on docker_images_template.yaml template
# Each job use matrics target (as input list to iterate) and setup
# wmcore_component which is used by corresponding template to perform
# set of actions. We also define here necessary secrets used by given template.

on:
# this section fires workflow on a specific tag which matches some pattern
push:
tags:
- '*.*.*'
# this section forces manual builds
workflow_dispatch:
inputs:
name:
description: 'WMCore services'

jobs:
# first job performs build and upload of packages to PyPI
build_and_publish_services:
name: Build_and_upload_to_pypi
strategy:
matrix:
target: [wmagent, wmagent-devtools, wmcore, reqmon, reqmgr2, global-workqueue, acdcserver, reqmgr2ms-unmerged,
reqmgr2ms-output, reqmgr2ms-rulecleaner, reqmgr2ms-transferor, reqmgr2ms-monitor]
uses: ./.github/workflows/pypi_build_publish_template.yaml
with:
wmcore_component: ${{ matrix.target }}
secrets:
pypy_token: ${{ secrets.PYPY_PRODUCTION }}

# second job, depends on build_and_publish_services, builds and upload
# docker images to CERN registry
build_images:
name: Build_images
needs: [build_and_publish_services]
strategy:
matrix:
target: [wmagent, reqmon, reqmgr2, reqmgr2ms-unmerged, global-workqueue,
reqmgr2ms-output, reqmgr2ms-rulecleaner, reqmgr2ms-transferor, reqmgr2ms-monitor]
uses: ./.github/workflows/docker_images_template.yaml
with:
wmcore_component: ${{ matrix.target }}
secrets:
CERN_LOGIN: ${{ secrets.CERN_LOGIN }}
CERN_TOKEN: ${{ secrets.CERN_TOKEN }}
19 changes: 0 additions & 19 deletions .github/workflows/pypy_build_publish.yaml

This file was deleted.