Skip to content
Merged
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
3 changes: 3 additions & 0 deletions opentofu/modules/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,21 @@ resource "oci_containerengine_cluster" "default_cluster" {
}

resource "oci_containerengine_addon" "oraoper_addon" {
count = var.use_cluster_addons ? 1 : 0
addon_name = "OracleDatabaseOperator"
cluster_id = oci_containerengine_cluster.default_cluster.id
remove_addon_resources_on_delete = true
}

resource "oci_containerengine_addon" "certmgr_addon" {
count = var.use_cluster_addons ? 1 : 0
addon_name = "CertManager"
cluster_id = oci_containerengine_cluster.default_cluster.id
remove_addon_resources_on_delete = true
}

resource "oci_containerengine_addon" "ingress_addon" {
count = var.use_cluster_addons ? 1 : 0
addon_name = "NativeIngressController"
cluster_id = oci_containerengine_cluster.default_cluster.id
remove_addon_resources_on_delete = true
Expand Down
5 changes: 5 additions & 0 deletions opentofu/modules/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ variable "byo_ocir_url" {
type = string
}

variable "use_cluster_addons" {
type = bool
default = true
}

variable "optimizer_version" {
type = string
}
Expand Down
1 change: 1 addition & 0 deletions opentofu/modules/vm/templates/cloudinit-compute.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ users:
package_update: false
packages:
- python3.11
- sqlcl

write_files:
- path: /etc/systemd/system/ai-optimizer.service
Expand Down
7 changes: 4 additions & 3 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
# Build from the project root directory:
# podman build -f src/Dockerfile -t ai-optimizer-aio:latest .
##################################################
FROM container-registry.oracle.com/os/oraclelinux:8-slim AS all_in_one_pyenv
FROM container-registry.oracle.com/os/oraclelinux:8 AS all_in_one_pyenv
ENV RUNUSER=oracleai \
VIRTUAL_ENV=/opt/.venv

RUN groupadd -g 10001 $RUNUSER && \
useradd -u 10001 -g $RUNUSER -md /app $RUNUSER && \
microdnf --nodocs -y install python3.11 python3.11-pip && \
microdnf clean all && \
dnf config-manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL8/oracle/software/\$basearch && \
dnf --nodocs -y install python3.11 python3.11-pip sqlcl java-21-openjdk-headless --nogpgcheck && \
dnf clean all && \
python3.11 -m venv --symlinks --upgrade-deps $VIRTUAL_ENV

COPY --chown=$RUNUSER:$RUNUSER src /opt/package/src
Expand Down
6 changes: 3 additions & 3 deletions src/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# Build from the project root directory:
# podman build -f src/client/Dockerfile -t ai-optimizer-client:latest .
#############################################################
FROM container-registry.oracle.com/os/oraclelinux:8-slim AS optimizer_base
FROM container-registry.oracle.com/os/oraclelinux:8 AS optimizer_base
ENV RUNUSER=oracleai \
VIRTUAL_ENV=/opt/.venv

RUN groupadd -g 10001 $RUNUSER && \
useradd -u 10001 -g $RUNUSER -md /app $RUNUSER && \
microdnf --nodocs -y install python3.11 python3.11-pip && \
microdnf clean all && \
dnf --nodocs -y install python3.11 python3.11-pip && \
dnf clean all && \
python3.11 -m venv --symlinks --upgrade-deps $VIRTUAL_ENV

COPY --chown=$RUNUSER:$RUNUSER src /opt/package/src
Expand Down
7 changes: 4 additions & 3 deletions src/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
# podman build -f src/server/Dockerfile -t ai-optimizer-server:latest .
#############################################################
# spell-checker: disable
FROM container-registry.oracle.com/os/oraclelinux:8-slim AS optimizer_base
FROM container-registry.oracle.com/os/oraclelinux:8 AS optimizer_base

ENV RUNUSER=oracleai
ENV RUNUSER=oracleai \
VIRTUAL_ENV=/opt/.venv

RUN groupadd -g 10001 $RUNUSER && \
useradd -u 10001 -g $RUNUSER -md /app $RUNUSER && \
microdnf --nodocs -y install python3.11 python3.11-pip && \
microdnf clean all && \
dnf config-manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL8/oracle/software/\$basearch && \
dnf --nodocs -y install python3.11 python3.11-pip && \
dnf clean all && \
python3.11 -m venv --symlinks --upgrade-deps $VIRTUAL_ENV

COPY --chown=$RUNUSER:$RUNUSER src /opt/package/src
Expand Down
Loading