Skip to content

Commit 0590309

Browse files
authored
Update Images and Instances to include SQLcl (#329)
* Add SQLcl to Images/Instances * Allow disable of addons
1 parent 77d48f3 commit 0590309

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

opentofu/modules/kubernetes/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,21 @@ resource "oci_containerengine_cluster" "default_cluster" {
9191
}
9292

9393
resource "oci_containerengine_addon" "oraoper_addon" {
94+
count = var.use_cluster_addons ? 1 : 0
9495
addon_name = "OracleDatabaseOperator"
9596
cluster_id = oci_containerengine_cluster.default_cluster.id
9697
remove_addon_resources_on_delete = true
9798
}
9899

99100
resource "oci_containerengine_addon" "certmgr_addon" {
101+
count = var.use_cluster_addons ? 1 : 0
100102
addon_name = "CertManager"
101103
cluster_id = oci_containerengine_cluster.default_cluster.id
102104
remove_addon_resources_on_delete = true
103105
}
104106

105107
resource "oci_containerengine_addon" "ingress_addon" {
108+
count = var.use_cluster_addons ? 1 : 0
106109
addon_name = "NativeIngressController"
107110
cluster_id = oci_containerengine_cluster.default_cluster.id
108111
remove_addon_resources_on_delete = true

opentofu/modules/kubernetes/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ variable "byo_ocir_url" {
130130
type = string
131131
}
132132

133+
variable "use_cluster_addons" {
134+
type = bool
135+
default = true
136+
}
137+
133138
variable "optimizer_version" {
134139
type = string
135140
}

opentofu/modules/vm/templates/cloudinit-compute.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ users:
1212
package_update: false
1313
packages:
1414
- python3.11
15+
- sqlcl
1516

1617
write_files:
1718
- path: /etc/systemd/system/ai-optimizer.service

src/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
# Build from the project root directory:
77
# podman build -f src/Dockerfile -t ai-optimizer-aio:latest .
88
##################################################
9-
FROM container-registry.oracle.com/os/oraclelinux:8-slim AS all_in_one_pyenv
9+
FROM container-registry.oracle.com/os/oraclelinux:8 AS all_in_one_pyenv
1010
ENV RUNUSER=oracleai \
1111
VIRTUAL_ENV=/opt/.venv
1212

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

1920
COPY --chown=$RUNUSER:$RUNUSER src /opt/package/src

src/client/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
# Build from the project root directory:
77
# podman build -f src/client/Dockerfile -t ai-optimizer-client:latest .
88
#############################################################
9-
FROM container-registry.oracle.com/os/oraclelinux:8-slim AS optimizer_base
9+
FROM container-registry.oracle.com/os/oraclelinux:8 AS optimizer_base
1010
ENV RUNUSER=oracleai \
1111
VIRTUAL_ENV=/opt/.venv
1212

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

1919
COPY --chown=$RUNUSER:$RUNUSER src /opt/package/src

src/server/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
# podman build -f src/server/Dockerfile -t ai-optimizer-server:latest .
77
#############################################################
88
# spell-checker: disable
9-
FROM container-registry.oracle.com/os/oraclelinux:8-slim AS optimizer_base
9+
FROM container-registry.oracle.com/os/oraclelinux:8 AS optimizer_base
1010

1111
ENV RUNUSER=oracleai
1212
ENV RUNUSER=oracleai \
1313
VIRTUAL_ENV=/opt/.venv
1414

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

2122
COPY --chown=$RUNUSER:$RUNUSER src /opt/package/src

0 commit comments

Comments
 (0)