Skip to content

Commit

Permalink
Merge branch 'main' into COST-4745-ocpgcp-network
Browse files Browse the repository at this point in the history
  • Loading branch information
cgoodfred authored Jul 3, 2024
2 parents d18f71d + 67af027 commit e8ef50e
Show file tree
Hide file tree
Showing 69 changed files with 1,912 additions and 798 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ PROMETHEUS_MULTIPROC_DIR='/tmp'
CURRENCY_URL=https://open.er-api.com/v6/latest/USD
UNLEASH_TOKEN='*:*.dbffffc83b1f92eeaf133a7eb878d4c58231acc159b5e1478ce53cfc'
POLLING_TIMER=60 # Set how often you can trigger downloads per provider
PROCESSING_WAIT_TIMER=3 # Set how many days before a long processing provider can be polled again
LARGE_PROCESSING_WAIT_TIMER=7 # Set how many days before a long LARGE customer processing provider can be polled again
MAX_GROUP_BY_OVERRIDE=3 # Set maximum aloud group bys
TAG_ENABLED_LIMIT=200 # Set the max amount of tags per account
DELAYED_TASK_TIME=30 # Set the seconds before a delayed summary task should expire
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Python
uses: actions/[email protected]
with:
python-version: '3.9'
python-version: '3.11'

- name: Run pre-commit checks
uses: pre-commit/[email protected]
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
max-parallel: 4
matrix:
python-version:
- '3.9'
- '3.11'
env:
COMPOSE_FILE: .github/postgres/docker-compose.yaml

Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
ARG TARGETARCH

FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS base

USER root

ENV PYTHON_VERSION=3.9 \
ENV PYTHON_VERSION=3.11 \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
LC_ALL=en_US.UTF-8 \
Expand All @@ -22,8 +24,8 @@ LABEL summary="$SUMMARY" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="Koku" \
io.openshift.expose-services="8000:http" \
io.openshift.tags="builder,python,python39,rh-python39" \
com.redhat.component="python39-docker" \
io.openshift.tags="builder,python,python3.11,rh-python3.11" \
com.redhat.component="python3.11-docker" \
name="Koku" \
version="1" \
maintainer="Red Hat Cost Management Services <[email protected]>"
Expand All @@ -33,7 +35,7 @@ LABEL summary="$SUMMARY" \
# gcc to compile some python packages (e.g. ciso8601)
# shadow-utils to make useradd available
# libpq-devel needed for building psycopg2
RUN INSTALL_PKGS="python39 python39-devel glibc-langpack-en gcc shadow-utils libpq-devel" && \
RUN INSTALL_PKGS="python3.11 python3.11-devel glibc-langpack-en gcc-c++ shadow-utils libpq-devel" && \
microdnf --nodocs -y upgrade && \
microdnf reinstall tzdata && \
microdnf -y --setopt=tsflags=nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \
Expand Down Expand Up @@ -61,8 +63,6 @@ RUN ldconfig
# No intermetiate steps for x86_64, but declare it so it can be used for the final image
FROM --platform=amd64 base AS stage-amd64

ARG TARGETARCH

FROM stage-${TARGETARCH} AS final
# PIPENV_DEV is set to true in the docker-compose allowing
# local builds to install the dev dependencies
Expand All @@ -72,7 +72,7 @@ ARG USER_ID=1000
# Create a Python virtual environment for use by any application to avoid
# potential conflicts with Python packages preinstalled in the main Python
# installation.
RUN python3.9 -m venv /pipenv-venv \
RUN python3.11 -m venv /pipenv-venv \
&& /pipenv-venv/bin/python -m pip install --upgrade pip setuptools \
&& /pipenv-venv/bin/python -m pip install pipenv

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def secrets = [
def configuration = [vaultUrl: params.VAULT_ADDRESS, vaultCredentialId: params.VAULT_CREDS_ID, engineVersion: 1]

pipeline {
agent { label 'insights' }
agent { label 'rhel8' }
options {
timestamps()
}
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ _koku-wait:
done

docker-build:
$(DOCKER_COMPOSE) build koku-base
# TARGETARCH: https://github.com/containers/podman/issues/23046 is resolved.
$(DOCKER_COMPOSE) build --build-arg TARGETARCH=$(shell uname -m | sed s/x86_64/amd64/) koku-base


docker-up: docker-build
$(DOCKER_COMPOSE) up -d --scale koku-worker=$(scale)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To submit an issue please visit [https://issues.redhat.com/projects/COST/]().

## Getting Started

This project is developed using Python 3.9. Make sure you have at least this version installed.
This project is developed using Python 3.11. Make sure you have at least this version installed.

### Prerequisites

Expand Down
14 changes: 5 additions & 9 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ function job_cleanup() {

trap job_cleanup EXIT ERR SIGINT SIGTERM

DOCKER_CONF="$TMP_JOB_DIR/.docker"
mkdir -p "$DOCKER_CONF"
docker --config="$DOCKER_CONF" login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker --config="$DOCKER_CONF" build --build-arg GIT_COMMIT="$GIT_COMMIT" -t "${IMAGE}:${IMAGE_TAG}" .
docker --config="$DOCKER_CONF" push "${IMAGE}:${IMAGE_TAG}"
podman login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
podman build --build-arg GIT_COMMIT="$GIT_COMMIT" -t "${IMAGE}:${IMAGE_TAG}" .
podman push "${IMAGE}:${IMAGE_TAG}"

docker --config="$DOCKER_CONF" tag "${IMAGE}:${IMAGE_TAG}" "${IMAGE}:latest"
docker --config="$DOCKER_CONF" push "${IMAGE}:latest"

docker --config="$DOCKER_CONF" logout
podman tag "${IMAGE}:${IMAGE_TAG}" "${IMAGE}:latest"
podman push "${IMAGE}:latest"
Loading

0 comments on commit e8ef50e

Please sign in to comment.