Skip to content

Commit

Permalink
[skip-ci] machine images
Browse files Browse the repository at this point in the history
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Feb 8, 2024
1 parent 8a6165e commit 35242da
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 40 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/fcos-podman-next-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- cron: '0 0 * * *'

env:
IMAGE_NAME: fcos
FCOS_IMAGE_NAME: fcos
MACHINE_IMAGE_NAME: machine-images
# IMAGE_ARCHS has to be comma separated
IMAGE_ARCHS: amd64, arm64
IMAGE_REGISTRY: quay.io/podman
Expand All @@ -32,6 +33,10 @@ jobs:
run: |
pip3 install git+https://github.com/packit/wait-for-copr.git@main
- name: Set up cosa
run: |
# TBD
- name: Check out code
uses: actions/checkout@v4

Expand Down Expand Up @@ -63,6 +68,12 @@ jobs:
org.opencontainers.image.description=FCOS image with rpms from rhcontainerbot/podman-next copr
org.opencontainers.image.revision=${{ github.sha }}
- name: Build Machine images
run: |
# TBD

- name: Add Machine images to Manifest
# TBD

- name: Echo Outputs
run: |
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/machine-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: MACHINE IMAGE TRIAL

on:
pull_request:
branches:
- main

jobs:
fcos-podman-next-image-build:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Pull container image
run: podman pull quay.io/coreos-assembler/coreos-assembler

- name: Build images
shell: bash -l {0}
run: |
source ./contrib/podman-next/fcos-podmanimage/cosa-snippet
mkdir ../fcos
cd ../fcos
cosa init https://github.com/coreos/fedora-coreos-config
cosa fetch
cosa build
78 changes: 39 additions & 39 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,54 @@ actions:
- "bash .packit.sh"

jobs:
- job: copr_build
trigger: pull_request
notifications:
failure_comment:
message: "Ephemeral COPR build failed. @containers/packit-build please check."
enable_net: true
targets:
- fedora-all-x86_64
- fedora-all-aarch64
- fedora-eln-x86_64
- fedora-eln-aarch64
- centos-stream+epel-next-8-x86_64
- centos-stream+epel-next-8-aarch64
- centos-stream+epel-next-9-x86_64
- centos-stream+epel-next-9-aarch64
additional_repos:
- "copr://rhcontainerbot/podman-next"
# - job: copr_build
# trigger: pull_request
# #notifications:
#failure_comment:
# message: "Ephemeral COPR build failed. @containers/packit-build please check."
# enable_net: true
#targets:
#- fedora-all-x86_64
#- fedora-all-aarch64
#- fedora-eln-x86_64
# - fedora-eln-aarch64
#- centos-stream+epel-next-8-x86_64
#- centos-stream+epel-next-8-aarch64
# - centos-stream+epel-next-9-x86_64
#- centos-stream+epel-next-9-aarch64
#additional_repos:
# - "copr://rhcontainerbot/podman-next"

# Run on commit to main branch
- job: copr_build
trigger: commit
notifications:
failure_comment:
message: "podman-next COPR build failed. @containers/packit-build please check."
#notifications:
#failure_comment:
# message: "podman-next COPR build failed. @containers/packit-build please check."
branch: main
owner: rhcontainerbot
project: podman-next
enable_net: true

- job: tests
identifier: cockpit-revdeps
trigger: pull_request
notifications:
failure_comment:
message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check."
targets:
- fedora-latest-stable
- fedora-development
tf_extra_params:
environments:
- artifacts:
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo
- type: repository-file
id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
tmt:
context:
revdeps: "yes"
# - job: tests
#identifier: cockpit-revdeps
#trigger: pull_request
#notifications:
#failure_comment:
# message: "Cockpit tests failed for commit {commit_sha}. @martinpitt, @jelly, @mvollmer please check."
#targets:
#- fedora-latest-stable
#- fedora-development
#tf_extra_params:
# environments:
# - artifacts:
# - type: repository-file
# id: https://copr.fedorainfracloud.org/coprs/g/cockpit/main-builds/repo/fedora-$releasever/group_cockpit-main-builds-fedora-$releasever.repo
# - type: repository-file
#id: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/repo/fedora-$releasever/rhcontainerbot-podman-next-fedora-$releasever.repo
#tmt:
#context:
# revdeps: "yes"

- job: propose_downstream
trigger: release
Expand Down
28 changes: 28 additions & 0 deletions contrib/podman-next/fcos-podmanimage/cosa-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

cosa() {
env | grep COREOS_ASSEMBLER
local -r COREOS_ASSEMBLER_CONTAINER_LATEST="quay.io/coreos-assembler/coreos-assembler:latest"
if [[ -z ${COREOS_ASSEMBLER_CONTAINER} ]] && $(podman image exists ${COREOS_ASSEMBLER_CONTAINER_LATEST}); then
local -r cosa_build_date_str="$(podman inspect -f "{{.Created}}" ${COREOS_ASSEMBLER_CONTAINER_LATEST} | awk '{print $1}')"
local -r cosa_build_date="$(date -d ${cosa_build_date_str} +%s)"
if [[ $(date +%s) -ge $((cosa_build_date + 60*60*24*7)) ]] ; then
echo -e "\e[0;33m----" >&2
echo "The COSA container image is more that a week old and likely outdated." >&2
echo "You should pull the latest version with:" >&2
echo "podman pull ${COREOS_ASSEMBLER_CONTAINER_LATEST}" >&2
echo -e "----\e[0m" >&2
sleep 10
fi
fi
set -x
podman run --rm -ti --security-opt=label=disable --privileged \
--uidmap=1000:0:1 --uidmap=0:1:1000 --uidmap=1001:1001:64536 \
-v=${PWD}:/srv/ --device=/dev/kvm --device=/dev/fuse \
--tmpfs=/tmp -v=/var/tmp:/var/tmp --name=cosa \
${COREOS_ASSEMBLER_CONFIG_GIT:+-v=$COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro} \
${COREOS_ASSEMBLER_GIT:+-v=$COREOS_ASSEMBLER_GIT/src/:/usr/lib/coreos-assembler/:ro} \
${COREOS_ASSEMBLER_ADD_CERTS:+-v=/etc/pki/ca-trust:/etc/pki/ca-trust:ro} \
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \
${COREOS_ASSEMBLER_CONTAINER:-$COREOS_ASSEMBLER_CONTAINER_LATEST} "$@"
rc=$?; set +x; return $rc
}

0 comments on commit 35242da

Please sign in to comment.