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

{WIP} Debug goreleaser #95

Closed
wants to merge 10 commits into from
Closed
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
72 changes: 36 additions & 36 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ builds:
- ppc64le
- s390x
dockers:
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
dockerfile: images/ansible-operator/Dockerfile
goos: linux
goarch: amd64
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
extra_files:
- "images/ansible-operator/Pipfile"
- "images/ansible-operator/Pipfile.lock"
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
dockerfile: images/ansible-operator/Dockerfile
goos: linux
goarch: arm64
use: buildx
build_flag_templates:
- "--platform=linux/arm64"
extra_files:
- "images/ansible-operator/Pipfile"
- "images/ansible-operator/Pipfile.lock"
#- image_templates:
# - "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
# dockerfile: images/ansible-operator/Dockerfile
# goos: linux
# goarch: amd64
# use: buildx
# build_flag_templates:
# - "--platform=linux/amd64"
# extra_files:
# - "images/ansible-operator/Pipfile"
# - "images/ansible-operator/Pipfile.lock"
#- image_templates:
# - "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
# dockerfile: images/ansible-operator/Dockerfile
# goos: linux
# goarch: arm64
# use: buildx
# build_flag_templates:
# - "--platform=linux/arm64"
# extra_files:
# - "images/ansible-operator/Pipfile"
# - "images/ansible-operator/Pipfile.lock"
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
dockerfile: images/ansible-operator/Dockerfile
Expand All @@ -51,24 +51,24 @@ dockers:
extra_files:
- "images/ansible-operator/Pipfile"
- "images/ansible-operator/Pipfile.lock"
- image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
dockerfile: images/ansible-operator/Dockerfile
goos: linux
goarch: s390x
use: buildx
build_flag_templates:
- "--platform=linux/s390x"
extra_files:
- "images/ansible-operator/Pipfile"
- "images/ansible-operator/Pipfile.lock"
#- image_templates:
# - "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
# dockerfile: images/ansible-operator/Dockerfile
# goos: linux
# goarch: s390x
# use: buildx
# build_flag_templates:
# - "--platform=linux/s390x"
# extra_files:
# - "images/ansible-operator/Pipfile"
# - "images/ansible-operator/Pipfile.lock"
docker_manifests:
- name_template: "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}"
image_templates:
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
# - "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
# - "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
- "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
# - "{{ .Env.IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
archives:
- format: binary
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)

export ENABLE_RELEASE_PIPELINE ?= false
export GORELEASER_ARGS ?= --snapshot --clean --timeout=120m
export GORELEASER_ARGS ?= --snapshot --clean --timeout=120m --debug
release: $(GORELEASER) ## Runs goreleaser. By default, this will run only as a snapshot and will not publish any artifacts unless it is run with different arguments. To override the arguments, run with "GORELEASER_ARGS=...". When run as a github action from a tag, this target will publish a full release.
$(GORELEASER) $(GORELEASER_ARGS)

Expand Down
2 changes: 1 addition & 1 deletion hack/generate/samples/ansible/testdata/inventory/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
127.0.0.1 ansible_connection=local

[all:vars]
ansible_python_interpreter=/usr/bin/python3
ansible_python_interpreter=/usr/bin/python3.12
35 changes: 19 additions & 16 deletions images/ansible-operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It is built with dependencies that take a while to download, thus speeding
# up ansible deploy jobs.

FROM registry.access.redhat.com/ubi8/ubi:8.9-1107 AS basebuilder
FROM registry.access.redhat.com/ubi9/ubi:9.4-1214 AS basebuilder

# Install Rust so that we can ensure backwards compatibility with installing/building the cryptography wheel across all platforms
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Expand All @@ -11,20 +11,22 @@ RUN rustc --version

# Copy python dependencies (including ansible) to be installed using Pipenv
COPY images/ansible-operator/Pipfile* ./

# Instruct pip(env) not to keep a cache of installed packages,
# to install into the global site-packages and
# to clear the pipenv cache as well
ENV PIP_NO_CACHE_DIR=1 \
PIPENV_SYSTEM=1 \
PIPENV_CLEAR=1
ENV PIP_NO_CACHE_DIR=1

# Ensure fresh metadata rather than cached metadata, install system and pip python deps,
# and remove those not needed at runtime.
RUN set -e && yum clean all && rm -rf /var/cache/yum/* \
&& yum update -y \
&& yum install -y libffi-devel openssl-devel python39-devel gcc python39-pip python39-setuptools \
&& pip3 install --upgrade pip~=23.3.2 \
&& pip3 install pipenv==2023.11.15 \
&& pipenv install --deploy \
&& yum install -y python3.12 \
&& yum install -y libffi-devel openssl-devel gcc python3.12-devel python3.12-pip python3.12-setuptools \
&& pip3.12 install --upgrade pip~=24.2 \
&& pip3.12 install pipenv \
&& pipenv requirements > requirements.txt \
&& pip3.12 install -r requirements.txt --prefix /usr/local \
# NOTE: This ignored vulnerability (70612) was detected in jinja2, \
# but the vulnerability is disputed and may never be fixed. See: \
# - https://github.com/advisories/GHSA-f6pv-j8mr-w6rr \
Expand All @@ -33,12 +35,12 @@ RUN set -e && yum clean all && rm -rf /var/cache/yum/* \
# NOTE: This ignored vulnerability (71064) was detected in requests, \
# but the upgraded version doesn't support the use case (protocol we are using).\
# Ref: https://github.com/operator-framework/ansible-operator-plugins/pull/67#issuecomment-2189164688
&& pipenv check --ignore 70612 --ignore 71064 \
&& yum remove -y gcc libffi-devel openssl-devel python39-devel \
&& safety check --ignore 70612 --ignore 71064 \
&& yum remove -y gcc libffi-devel openssl-devel python3.12-devel \
&& yum clean all \
&& rm -rf /var/cache/yum

FROM registry.access.redhat.com/ubi8/ubi:8.9-1107 as base
FROM registry.access.redhat.com/ubi9/ubi:9.4-1214 AS base
ARG TARGETARCH

# Label this image with the repo and commit that built it, for freshmaking purposes.
Expand All @@ -53,14 +55,15 @@ RUN mkdir -p /etc/ansible \

RUN set -e && yum clean all && rm -rf /var/cache/yum/* \
&& yum update -y \
&& yum install -y python39-pip python39-setuptools \
&& pip3 install --upgrade pip~=23.3.2 \
&& pip3 install pipenv==2023.11.15 \
&& yum install -y python3.12 \
&& yum install -y python3.12-pip python3.12-setuptools \
&& pip3.12 install --upgrade pip~=24.2 \
&& pip3.12 install pipenv==2024.0.1 \
&& yum clean all \
&& rm -rf /var/cache/yum

COPY --from=basebuilder /usr/local/lib64/python3.9/site-packages /usr/local/lib64/python3.9/site-packages
COPY --from=basebuilder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
COPY --from=basebuilder /usr/local/lib64/python3.12/site-packages /usr/local/lib64/python3.12/site-packages
COPY --from=basebuilder /usr/local/lib/python3.12 /usr/local/lib/python3.12
COPY --from=basebuilder /usr/local/bin /usr/local/bin

ENV TINI_VERSION=v0.19.0
Expand Down
11 changes: 7 additions & 4 deletions images/ansible-operator/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ verify_ssl = true
name = "pypi"

[packages]
ansible-runner = "~=2.3.3"
ansible-core = "==2.17.4"
ansible-runner = "~=2.4.0"
ansible-runner-http = "~=1.0.0"
ansible-core = "~=2.15.9"
urllib3 = "~=1.26.17"
urllib3 = "~=1.26.2"
kubernetes = "==29.0.0"
safety = "==3.2.7"
PyYAML = "==6.0.2"
requests = "==2.31.0"

[dev-packages]

[requires]
python_version = "3.9"
python_version = "3.12"
Loading
Loading