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

Add initial draft for building WMCore images via CI/CD #11339

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
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
107 changes: 107 additions & 0 deletions .github/workflows/images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Build

on:
push:
tags:
- '*.*.*'
vkuznet marked this conversation as resolved.
Show resolved Hide resolved

jobs:

build:
name: Build
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 wmagent image
run: |
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/pypi/wmagent/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/wmagent

- name: Build reqmon image
run: |
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/pypi/reqmon/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/reqmon

- name: Build reqmgr2ms-output image
run: |
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/pypi/reqmgr2ms-output/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/reqmgr2ms-output

- name: Build reqmgr2ms-rulecleaner image
run: |
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/docker/pypi/reqmgr2ms-rulecleaner/Dockerfile
sed -i -e "s,ENV TAG=.*,ENV TAG=${{steps.get-ref.rulecleaners.tag}},g" Dockerfile
vkuznet marked this conversation as resolved.
Show resolved Hide resolved
cat Dockerfile
docker build . --tag registry.cern.ch/cmsweb/reqmgr2ms-rulecleaner

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

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

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

# - name: Login to registry.cern.ch
# uses: docker/[email protected]
# 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:
# username: ${{ secrets.CERN_LOGIN }}
# password: ${{ secrets.CERN_TOKEN }}
# registry: registry.cern.ch
# repository: cmsweb/wmarchive
# tag_with_ref: true

# - name: Login to docker github registry
# uses: docker/[email protected]
# with:
# registry: docker.pkg.github.com
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Login to Registry
# uses: docker/[email protected]
# with:
# registry: docker.pkg.github.com
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Push new image to k8s
# run: |
# curl -ksLO https://raw.githubusercontent.com/vkuznet/imagebot/main/imagebot.sh
# sed -i -e "s,COMMIT,${{github.sha}},g" -e "s,REPOSITORY,${{github.repository}},g" -e "s,NAMESPACE,wma,g" -e "s,TAG,${{steps.get-ref.outputs.tag}},g" -e "s,IMAGE,registry.cern.ch/cmsweb/wmarchive,g" -e "s,SERVICE,wmarchive,g" -e "s,HOST,${{secrets.IMAGEBOT_URL}},g" imagebot.sh
# chmod +x imagebot.sh
# cat imagebot.sh
# sh ./imagebot.sh