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

MGMT-15963: Upgrade dockefiles to use centos:stream9 and build with podman #8

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File with Arguments",
"type": "debugpy",
"request": "launch",
"program": "main.py",
"console": "integratedTerminal",
"args": [
"200",
"/home/paulmaidment/Documents/swarm-test/testplan.yaml",
"/home/paulmaidment/Documents/swarm-test/service_config.yaml",
],
"env": {
"KUBECONFIG": "/home/paulmaidment/Downloads/kubeconfig.testcluster"
},
"sudo": true,
}
]
}
2 changes: 1 addition & 1 deletion Dockerfile.assisted-swarm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/centos/centos:stream8
FROM quay.io/centos/centos:stream9

ARG WORK_DIR=/data

Expand Down
34 changes: 26 additions & 8 deletions Dockerfile.assisted-swarm-build
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
FROM registry.ci.openshift.org/openshift/release:golang-1.17
ENV GO111MODULE=on
ENV GOFLAGS=""
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS golang
RUN chmod g+xw -R /usr/local/go

FROM quay.io/centos/centos:stream9

ENV GOPATH=/go
ENV GOROOT=/usr/local/go
ENV VIRTUAL_ENV=/opt/venv
# A directory in the path with write permission even for non-root users
ENV TOOLS=/tools/
ENV PATH="$VIRTUAL_ENV/bin:$GOROOT/bin:$GOPATH/bin:$TOOLS:$PATH"

RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v1.53.2
COPY --from=quay.io/goswagger/swagger:sha-5d0a00d /usr/bin/swagger /usr/bin/goswagger

COPY --from=quay.io/goswagger/swagger:v0.28.0 /usr/bin/swagger /usr/bin/goswagger
COPY --from=quay.io/edge-infrastructure/swagger-codegen-cli:2.4.18 /opt/swagger-codegen-cli /opt/swagger-codegen-cli
COPY --from=golang /usr/bin/gotestsum /usr/bin/make /usr/bin/
COPY --from=golang /usr/local/go /usr/local/go
COPY --from=quay.io/openshift/origin-cli:latest /usr/bin/oc /usr/bin
COPY --from=quay.io/operator-framework/upstream-opm-builder:v1.16.1 /bin/opm /bin
COPY --from=registry.k8s.io/kustomize/kustomize:v4.3.0 /app/kustomize /usr/bin/
COPY --from=quay.io/coreos/shellcheck-alpine:v0.5.0 /bin/shellcheck /usr/bin/shellcheck

USER 0

RUN curl -L https://github.com/stoplightio/spectral/releases/download/v5.9.1/spectral-linux -o /usr/local/bin/spectral && chmod +x /usr/local/bin/spectral

RUN yum install -y --setopt=skip_missing_names_on_install=False docker podman
RUN mkdir build && chmod g+xw -R build/
COPY ./hack/setup_env.sh ./
RUN ./setup_env.sh podman_remote && \
dnf clean all




RUN chmod g+xw -R .
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
ASSISTED_SWARM = build/assisted-swarm
CONTAINER_COMMAND := $(or $(CONTAINER_COMMAND),docker)
CONTAINER_COMMAND := podman-remote
IMAGE := $(or $(IMAGE),quay.io/oamizur/assisted-swarm:latest)
ifeq ($(CONTAINER_COMMAND), docker)
CONTAINER_COMMAND = $(shell docker -v | cut -f1 -d' ' | tr '[:upper:]' '[:lower:]')
endif

.PHONY: build-image generate clean

Expand Down
28 changes: 27 additions & 1 deletion assisted_swarm_client/assisted_swarm/models/new_agent_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class NewAgentParams(object):
'containers_storage_conf': 'str',
'dry_forced_host_id': 'str',
'dry_forced_host_ipv4': 'str',
'dry_forced_host_ipv6': 'str',
'dry_forced_mac_address': 'str',
'dry_forced_hostname': 'str',
'dry_fake_reboot_marker_path': 'str',
Expand All @@ -56,13 +57,14 @@ class NewAgentParams(object):
'containers_storage_conf': 'containers_storage_conf',
'dry_forced_host_id': 'dry_forced_host_id',
'dry_forced_host_ipv4': 'dry_forced_host_ipv4',
'dry_forced_host_ipv6': 'dry_forced_host_ipv6',
'dry_forced_mac_address': 'dry_forced_mac_address',
'dry_forced_hostname': 'dry_forced_hostname',
'dry_fake_reboot_marker_path': 'dry_fake_reboot_marker_path',
'dry_cluster_hosts_path': 'dry_cluster_hosts_path'
}

def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cacert=None, pull_secret=None, containers_conf=None, containers_storage_conf=None, dry_forced_host_id=None, dry_forced_host_ipv4=None, dry_forced_mac_address=None, dry_forced_hostname=None, dry_fake_reboot_marker_path=None, dry_cluster_hosts_path=None): # noqa: E501
def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cacert=None, pull_secret=None, containers_conf=None, containers_storage_conf=None, dry_forced_host_id=None, dry_forced_host_ipv4=None, dry_forced_host_ipv6=None, dry_forced_mac_address=None, dry_forced_hostname=None, dry_fake_reboot_marker_path=None, dry_cluster_hosts_path=None): # noqa: E501
"""NewAgentParams - a model defined in Swagger""" # noqa: E501

self._service_url = None
Expand All @@ -74,6 +76,7 @@ def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cace
self._containers_storage_conf = None
self._dry_forced_host_id = None
self._dry_forced_host_ipv4 = None
self._dry_forced_host_ipv6 = None
self._dry_forced_mac_address = None
self._dry_forced_hostname = None
self._dry_fake_reboot_marker_path = None
Expand All @@ -98,6 +101,8 @@ def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cace
self.dry_forced_host_id = dry_forced_host_id
if dry_forced_host_ipv4 is not None:
self.dry_forced_host_ipv4 = dry_forced_host_ipv4
if dry_forced_host_ipv6 is not None:
self.dry_forced_host_ipv6 = dry_forced_host_ipv6
if dry_forced_mac_address is not None:
self.dry_forced_mac_address = dry_forced_mac_address
if dry_forced_hostname is not None:
Expand Down Expand Up @@ -296,6 +301,27 @@ def dry_forced_host_ipv4(self, dry_forced_host_ipv4):

self._dry_forced_host_ipv4 = dry_forced_host_ipv4

@property
def dry_forced_host_ipv6(self):
"""Gets the dry_forced_host_ipv6 of this NewAgentParams. # noqa: E501


:return: The dry_forced_host_ipv6 of this NewAgentParams. # noqa: E501
:rtype: str
"""
return self._dry_forced_host_ipv6

@dry_forced_host_ipv6.setter
def dry_forced_host_ipv6(self, dry_forced_host_ipv6):
"""Sets the dry_forced_host_ipv6 of this NewAgentParams.


:param dry_forced_host_ipv6: The dry_forced_host_ipv6 of this NewAgentParams. # noqa: E501
:type: str
"""

self._dry_forced_host_ipv6 = dry_forced_host_ipv6

@property
def dry_forced_mac_address(self):
"""Gets the dry_forced_mac_address of this NewAgentParams. # noqa: E501
Expand Down
1 change: 1 addition & 0 deletions assisted_swarm_client/docs/NewAgentParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**containers_storage_conf** | **str** | | [optional]
**dry_forced_host_id** | **str** | | [optional]
**dry_forced_host_ipv4** | **str** | | [optional]
**dry_forced_host_ipv6** | **str** | | [optional]
**dry_forced_mac_address** | **str** | | [optional]
**dry_forced_hostname** | **str** | | [optional]
**dry_fake_reboot_marker_path** | **str** | | [optional]
Expand Down
8 changes: 5 additions & 3 deletions client/swarm/create_new_agent_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading