Skip to content

Commit

Permalink
feat: upgrade to bobcat (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser authored Jan 16, 2024
1 parent 4b3587b commit 403c042
Show file tree
Hide file tree
Showing 44 changed files with 697 additions and 3,409 deletions.
6 changes: 3 additions & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"packageNameTemplate": "https://github.com/openstack/{{{depName}}}",
"currentValueTemplate": "stable/{{{version}}}",
"matchStrings": [
"ARG PROJECT=(?<depName>.*)",
"ARG RELEASE=(?<version>.*)",
"ARG REF=(?<currentDigest>.*)"
"ARG --global RELEASE=(?<version>.*)",
"ARG --global PROJECT=(?<depName>.*)",
"ARG --global PROJECT_REF=(?<currentDigest>.*)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: ^images/.*/patches/.*\.patch$
exclude: ^images/.*/patches/.*/.*\.patch$

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.0.0
Expand Down
1 change: 0 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ libvirt-tls-sidecar.platform-image:
--platform=linux/amd64 \
(+libvirt-tls-sidecar.build/main --GOARCH=$TARGETARCH --VARIANT=$TARGETVARIANT) /usr/bin/libvirt-tls-sidecar
ENTRYPOINT ["/usr/bin/libvirt-tls-sidecar"]
LABEL org.opencontainers.image.source=https://github.com/vexxhost/atmosphere
SAVE IMAGE --push ghcr.io/vexxhost/atmosphere/libvirt-tls-sidecar:latest

libvirt-tls-sidecar.image:
Expand Down
15 changes: 15 additions & 0 deletions docs/developer/images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Images

The images are built using Earthly and the contents of these files are all
located in the `images/` directory.

## Adding Gerrit packages

If you need to cherry-pick a specific Gerrit patch, you can use the following
command to download and extract the patch:

```bash
earthly ./images+fetch-gerrit-patch \
--IMAGE keystone \
--CHANGE 893737
```
70 changes: 0 additions & 70 deletions docs/developer/repos.md

This file was deleted.

34 changes: 20 additions & 14 deletions images/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ CREATE_PROJECT_USER:
mkdir -p /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT} && \
chown -Rv ${PROJECT}:${PROJECT} /etc/${PROJECT} /var/log/${PROJECT} /var/lib/${PROJECT} /var/cache/${PROJECT}

APPLY_PATCHES:
COMMAND
COPY --if-exists patches /patches
IF [ -d /patches ]
RUN \
apt-get update && \
apt-get install -y patch && \
for patch in /patches/*.patch; do \
patch -d /var/lib/openstack/lib/python3.10/site-packages/ -p1 < $patch; \
done && \
apt-get purge -y --auto-remove patch && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
END
fetch-gerrit-patch:
FROM ./base+image
DO +APT_INSTALL --PACKAGES "ca-certificates curl git jq"
ARG --required IMAGE
ARG PROJECT=${IMAGE}
ARG --required CHANGE
ARG PROJECT_REF=master
DO ./openstack-service+GIT_CHECKOUT \
--PROJECT=${PROJECT} \
--PROJECT_REF=${PROJECT_REF}
ARG REF=$(curl "https://review.opendev.org/changes/?q=${CHANGE}&o=CURRENT_REVISION" | tail -1 | jq -r '.[0].revisions[].ref')
COPY ${IMAGE}/patches/${PROJECT} /patches
RUN \
git fetch https://review.opendev.org/openstack/${PROJECT} ${REF} && \
git format-patch -1 --output-directory /gerrit FETCH_HEAD
ARG PATCH_ID=$(ls -1 /patches | wc -l | xargs printf "%04d")
RUN \
cp /gerrit/0001-* \
/patches/${PATCH_ID}-$(basename /gerrit/*.patch | sed 's/0001-//')
SAVE ARTIFACT /patches AS LOCAL ${IMAGE}/patches/${PROJECT}
24 changes: 14 additions & 10 deletions images/barbican/Earthfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
VERSION 0.7

ARG --global PROJECT=barbican
ARG --global RELEASE=2023.2
ARG --global PROJECT_REF=a00fcade4138ffc52cd9c84b5999297966f019b5

build:
FROM ../openstack-service+builder --RELEASE=${RELEASE}
DO ../openstack-service+BUILD_VENV \
--PROJECT=${PROJECT} \
--PROJECT_REF=${PROJECT_REF} \
--PIP_PACKAGES="pykmip"

image:
ARG PROJECT=barbican
ARG RELEASE=zed
ARG REF=7d6749fcb1ad16a3350de82cd8e523d5b55306f8
FROM ../openstack-service+image \
--PROJECT ${PROJECT} \
--RELEASE ${RELEASE} \
--PROJECT_REF ${REF} \
--PIP_PACKAGES "pykmip"
DO ../+APPLY_PATCHES
FROM ../openstack-service+image --RELEASE ${RELEASE} --PROJECT ${PROJECT}
COPY +build/venv /var/lib/openstack
SAVE IMAGE --push \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${RELEASE} \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${REF}
ghcr.io/vexxhost/atmosphere/${PROJECT}:${PROJECT_REF}
1 change: 1 addition & 0 deletions images/base/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ VERSION 0.7

image:
FROM ubuntu:jammy
LABEL org.opencontainers.image.source=https://github.com/vexxhost/atmosphere
29 changes: 16 additions & 13 deletions images/cinder/Earthfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
VERSION 0.7

ARG --global PROJECT=cinder
ARG --global RELEASE=2023.2
ARG --global PROJECT_REF=7d158234b72f04e780e307b0375cedf30dd8fb90

build:
FROM ../openstack-service+builder --RELEASE=${RELEASE}
DO ../openstack-service+BUILD_VENV \
--PROJECT=${PROJECT} \
--PROJECT_REF=${PROJECT_REF} \
--PIP_PACKAGES="purestorage"

image:
ARG PROJECT=cinder
ARG RELEASE=zed
ARG REF=011e6549259c0433ceb594d8083f6c838d964311
FROM ../openstack-service+image \
--PROJECT ${PROJECT} \
--RELEASE ${RELEASE} \
--PROJECT_REF ${REF} \
--PIP_PACKAGES "purestorage"
DO \
../+APT_INSTALL \
--PACKAGES "ceph-common lsscsi nvme-cli python3-rados python3-rbd qemu-utils sysfsutils udev util-linux"
DO ../+APPLY_PATCHES
FROM ../openstack-service+image --RELEASE ${RELEASE} --PROJECT ${PROJECT}
COPY +build/venv /var/lib/openstack
COPY ../kubernetes+image/kubectl /usr/local/bin/kubectl
DO ../+APT_INSTALL \
--PACKAGES "ceph-common lsscsi nvme-cli python3-rados python3-rbd qemu-utils sysfsutils udev util-linux"
SAVE IMAGE --push \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${RELEASE} \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${REF}
ghcr.io/vexxhost/atmosphere/${PROJECT}:${PROJECT_REF}
25 changes: 14 additions & 11 deletions images/designate/Earthfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
VERSION 0.7

ARG --global PROJECT=designate
ARG --global RELEASE=2023.2
ARG --global PROJECT_REF=2c817b3d7f01de44023f195c6e8de8853683a54a

build:
FROM ../openstack-service+builder --RELEASE=${RELEASE}
DO ../openstack-service+BUILD_VENV \
--PROJECT=${PROJECT} \
--PROJECT_REF=${PROJECT_REF}

image:
ARG PROJECT=designate
ARG RELEASE=zed
ARG REF=d247267823034c5e656f74e91b50475aa54d3fa6
FROM ../openstack-service+image \
--PROJECT ${PROJECT} \
--RELEASE ${RELEASE} \
--PROJECT_REF ${REF}
DO \
../+APT_INSTALL \
FROM ../openstack-service+image --RELEASE ${RELEASE} --PROJECT ${PROJECT}
COPY +build/venv /var/lib/openstack
DO ../+APT_INSTALL \
--PACKAGES "bind9utils"
DO ../+APPLY_PATCHES
SAVE IMAGE --push \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${RELEASE} \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${REF}
ghcr.io/vexxhost/atmosphere/${PROJECT}:${PROJECT_REF}
38 changes: 25 additions & 13 deletions images/glance/Earthfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
VERSION 0.7

ARG --global PROJECT=glance
ARG --global RELEASE=2023.2
ARG --global PROJECT_REF=9a4a3067b5c7c7f8ee9363bd939a3d86b260d660

build.plugin:
ARG PLUGIN
FROM ../openstack-service+builder --RELEASE=${RELEASE}
DO ../openstack-service+GIT_CHECKOUT \
--PROJECT=${PLUGIN} \
--PROJECT_REF=stable/${RELEASE}
SAVE ARTIFACT /src

build:
FROM ../openstack-service+builder --RELEASE=${RELEASE}
COPY (+build.plugin/src --PLUGIN=glance_store) /glance_store
DO ../openstack-service+BUILD_VENV \
--PROJECT=${PROJECT} \
--PROJECT_REF=${PROJECT_REF} \
--PIP_PACKAGES="/glance_store[cinder]"

image:
ARG PROJECT=glance
ARG RELEASE=zed
ARG REF=06a18202ab52c64803f044b8f848ed1c160905d2
FROM ../openstack-service+image \
--PROJECT ${PROJECT} \
--RELEASE ${RELEASE} \
--PROJECT_REF ${REF} \
--PIP_PACKAGES "glance_store[cinder]"
DO \
../+APT_INSTALL \
--PACKAGES "ceph-common lsscsi nvme-cli python3-rados python3-rbd qemu-utils sysfsutils udev util-linux"
DO ../+APPLY_PATCHES
FROM ../openstack-service+image --RELEASE ${RELEASE} --PROJECT ${PROJECT}
COPY +build/venv /var/lib/openstack
COPY ../kubernetes+image/kubectl /usr/local/bin/kubectl
DO ../+APT_INSTALL \
--PACKAGES "ceph-common lsscsi nvme-cli python3-rados python3-rbd qemu-utils sysfsutils udev util-linux"
SAVE IMAGE --push \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${RELEASE} \
ghcr.io/vexxhost/atmosphere/${PROJECT}:${REF}
ghcr.io/vexxhost/atmosphere/${PROJECT}:${PROJECT_REF}
Loading

0 comments on commit 403c042

Please sign in to comment.