Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 1 | VERSION 0.7 |
| 2 | |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 3 | PIP_INSTALL: |
| 4 | COMMAND |
| 5 | ARG PACKAGES |
| 6 | RUN --mount=type=cache,target=/root/.cache \ |
| 7 | /var/lib/openstack/bin/pip3 install \ |
| 8 | --constraint /upper-constraints.txt \ |
| 9 | ${PACKAGES} |
| 10 | |
| 11 | GIT_CHECKOUT: |
| 12 | COMMAND |
| 13 | ARG PROJECT |
| 14 | ARG PROJECT_REPO=https://github.com/openstack/${PROJECT} |
| 15 | ARG PROJECT_REF |
| 16 | GIT CLONE --branch ${PROJECT_REF} ${PROJECT_REPO} /src |
| 17 | WORKDIR /src |
| 18 | RUN \ |
| 19 | git remote set-url origin ${PROJECT_REPO} && \ |
| 20 | git fetch --unshallow |
| 21 | COPY --if-exists patches/${PROJECT} /patches |
| 22 | IF [ -d /patches ] |
| 23 | RUN git apply --verbose /patches/*.patch |
| 24 | END |
| 25 | |
| 26 | BUILD_VENV: |
| 27 | COMMAND |
| 28 | ARG PROJECT |
| 29 | ARG PROJECT_REF |
| 30 | DO +GIT_CHECKOUT --PROJECT=${PROJECT} --PROJECT_REF=${PROJECT_REF} |
| 31 | ARG EXTRAS="" |
| 32 | ARG PIP_PACKAGES="" |
| 33 | DO +PIP_INSTALL --PACKAGES "/src${EXTRAS} ${PIP_PACKAGES}" |
| 34 | SAVE ARTIFACT /var/lib/openstack venv |
| 35 | |
| 36 | requirements: |
| 37 | FROM ../base+image |
| 38 | ARG RELEASE |
Mohammed Naser | 10ab7ef | 2024-01-17 15:23:33 -0500 | [diff] [blame] | 39 | IF [ "${RELEASE}" = "master" ] |
| 40 | ARG BRANCH=master |
| 41 | ELSE |
| 42 | ARG BRANCH=stable/${RELEASE} |
| 43 | END |
| 44 | GIT CLONE --branch ${BRANCH} https://github.com/openstack/requirements /src |
| 45 | RUN \ |
| 46 | sed -i '/glance-store/d' /src/upper-constraints.txt && \ |
| 47 | sed -i '/horizon/d' /src/upper-constraints.txt |
Mohammed Naser | 36d353a | 2024-01-17 13:03:05 -0500 | [diff] [blame] | 48 | SAVE ARTIFACT /src/upper-constraints.txt |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 49 | |
| 50 | builder: |
Mohammed Naser | c639230 | 2024-01-04 00:43:02 -0500 | [diff] [blame] | 51 | ARG RELEASE |
| 52 | FROM ../cloud-archive-base+image --RELEASE=${RELEASE} |
| 53 | DO ../+APT_INSTALL --PACKAGES "\ |
| 54 | build-essential \ |
| 55 | curl \ |
| 56 | git \ |
| 57 | libldap2-dev \ |
| 58 | libpcre3-dev \ |
| 59 | libsasl2-dev \ |
| 60 | libssl-dev \ |
| 61 | lsb-release \ |
| 62 | openssh-client \ |
| 63 | python3 \ |
| 64 | python3-dev \ |
| 65 | python3-pip \ |
| 66 | python3-venv" |
| 67 | RUN --mount type=cache,target=/root/.cache \ |
| 68 | python3 -m venv --upgrade --system-site-packages /var/lib/openstack |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 69 | COPY \ |
| 70 | (+requirements/upper-constraints.txt --RELEASE=${RELEASE}) \ |
| 71 | /upper-constraints.txt |
| 72 | DO +PIP_INSTALL --PACKAGES "pymysql python-memcached cryptography uwsgi" |
Mohammed Naser | c639230 | 2024-01-04 00:43:02 -0500 | [diff] [blame] | 73 | |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 74 | image: |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 75 | ARG --required RELEASE |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 76 | FROM ../cloud-archive-base+image --RELEASE=${RELEASE} |
Mohammed Naser | aa48ddb | 2023-12-30 00:11:22 -0500 | [diff] [blame] | 77 | ENV PATH=/var/lib/openstack/bin:$PATH |
Mohammed Naser | 403c042 | 2024-01-16 14:36:28 -0500 | [diff] [blame] | 78 | ARG --required PROJECT |
| 79 | DO ../+CREATE_PROJECT_USER --PROJECT=${PROJECT} |