Skip to content

Commit

Permalink
working on m1 up until elastic
Browse files Browse the repository at this point in the history
  • Loading branch information
4141done committed Nov 13, 2023
1 parent b4944cd commit 07b5990
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 222 deletions.
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.18
3.11.6
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python 3.9.18
python 3.11.6
pulumi 3.92.0
4 changes: 3 additions & 1 deletion bin/setup_venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ function distro_like() {

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

echo "[DEBUG] script_dir set to $script_dir"

# Unset if defined
unset VIRTUAL_ENV

Expand Down Expand Up @@ -91,7 +93,7 @@ if ! command -v python3 >/dev/null; then

mkdir -p "${PYENV_ROOT}"
git_clone_log="$(mktemp -t pyenv_git_clone-XXXXXXX.log)"
if git clone --depth 1 --branch v2.0.3 https://github.com/pyenv/pyenv.git "${PYENV_ROOT}" 2>"${git_clone_log}"; then
if git clone --depth 1 --branch v2.3.31 https://github.com/pyenv/pyenv.git "${PYENV_ROOT}" 2>"${git_clone_log}"; then
rm "${git_clone_log}"
else
echo >&2 "Error cloning pyenv repository:"
Expand Down
10 changes: 6 additions & 4 deletions docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG ARCH=amd64

FROM $ARCH/docker:latest AS docker

FROM $ARCH/debian:bullseye-slim
FROM $ARCH/debian:bookworm-slim
ARG DEBIAN_FRONTEND=noninteractive
ARG UID
ARG GID
Expand Down Expand Up @@ -35,9 +35,11 @@ RUN set -eux; \
nano \
vim \
wget \
zlib1g-dev; \
su --group runner runner --login --command '/pulumi/projects/kic-reference-architectures/bin/setup_venv.sh'; \
echo 'source /pulumi/projects/kic-reference-architectures/pulumi/python/venv/bin/activate' >> /pulumi/projects/kic-reference-architectures/.bashrc; \
zlib1g-dev;

RUN su --group runner runner --login --command '/pulumi/projects/kic-reference-architectures/bin/setup_venv.sh';

RUN echo 'source /pulumi/projects/kic-reference-architectures/pulumi/python/venv/bin/activate' >> /pulumi/projects/kic-reference-architectures/.bashrc; \
apt-get purge --yes \
gcc \
libbz2-dev \
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG ARCH=amd64

FROM $ARCH/docker:latest AS docker
FROM --platform=linux/amd64 docker:latest AS docker

FROM $ARCH/ubuntu:focal
FROM --platform=linux/amd64 ubuntu:23.04
ARG DEBIAN_FRONTEND=noninteractive
ARG UID
ARG GID
Expand Down
15 changes: 8 additions & 7 deletions pulumi/python/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ verify_ssl = true
name = "pypi"

[packages]
awscli = "~=1.25.35"
fart = "~=0.1.5"
lolcat = "~=1.4"
passlib = "~=1.7.4"
pulumi-aws = "5.31.0"
pulumi-docker = "==3.1.0"
# pulumi-docker = "~=4.4.4"
pulumi-eks = ">=0.41.2"
pulumi-kubernetes = "==3.23.0"
pulumi-kubernetes = "==3.30.2"
pycryptodome = "~=3.14.0"
requests = "~=2.27.1"
setuptools = "==49.6.0"
setuptools-git-versioning = "==1.9.2"
yamlreader = "==3.0.4"
yamlreader = "*"
pulumi-digitalocean = "==4.12.0"
pulumi = "~=3.36.0"
PyYAML = "5.3.1"
wheel = "0.37.1"
pulumi = "~=3.93"
grpcio = "*"
PyYAML = "==6.0.1"
wheel = "0.41.3"
nodeenv = "~=1.6.0"

[requires]
python_version = "3.9"
python_version = "3.11"
293 changes: 113 additions & 180 deletions pulumi/python/Pipfile.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions pulumi/python/kubernetes/nginx/ingress-controller/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,13 @@ def namespace_by_name(name):
provider=k8s_provider))

pstatus = kic_chart.status

pstatus.apply(lambda status: pulumi.log.info(f"[DEBUG]: Helm chart status: {status}"))
srv = Service.get(resource_name="nginx-ingress",
id=Output.concat("nginx-ingress", "/", pstatus.name, "-nginx-ingress"),
id=Output.concat("nginx-ingress", "/", pstatus.name, "-nginx-ingress-controller"),
opts=pulumi.ResourceOptions(provider=k8s_provider))

ingress_service = srv.status


def ingress_hostname(_ingress_service):
# Attempt to get the hostname as returned from the helm chart
if 'load_balancer' in _ingress_service:
Expand Down
21 changes: 0 additions & 21 deletions pulumi/python/requirements.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ def _docker_pull(self, image_name: str) -> str:
:param image_name: full container image name in the format of repository:tag
:return full image name with server name (e.g. docker.io/library/debian:buster-slim)
"""
cmd = f'docker pull --quiet "{image_name}"'

# The below is a hack for arm systems in which ECR wants
# all architectures in the manifest to exist locally on push
# only the linux/amd64 image will actually be used. I'm aware this is very wasteful but the workaround eludes me at the moment
# manifest_architectures = ["linux/arm/v7", "linux/arm64", "linux/ppc64le", "linux/s390x"]
# (this is still not working but a workaround is disabling containerd)
# for arch in manifest_architectures:
# cmd = f'docker pull --platform "{arch}" --quiet "{image_name}"'
# res, _ = self._run_docker(cmd=cmd)

cmd = f'docker pull --platform linux/amd64 --quiet "{image_name}"'
res, _ = self._run_docker(cmd=cmd)
image_name = res.strip()
return image_name
Expand Down
2 changes: 1 addition & 1 deletion pulumi/python/utility/kic-pulumi-utils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
version_config=True,
packages=['kic_util'],
install_requires=[
'pyyaml>=5.3.1,<6.0', 'passlib>=1.7.4,<2.0.0', 'GitPython>=3.1.18,<3.2.0'
'pyyaml', 'passlib>=1.7.4,<2.0.0', 'GitPython>=3.1.18,<3.2.0'
])

0 comments on commit 07b5990

Please sign in to comment.