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

chore(cloud-native)!: remove couchbase support from OCI images #10132

Merged
merged 6 commits into from
Nov 14, 2024
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: 0 additions & 3 deletions demos/benchmarking/docker-jans-loadtesting-jmeter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ ENV FQDN="https://demoexample.jans.io" \
RUN_DCR_TEST=false \
TEST_USERS_PREFIX_STRING="test_user" \
THREAD_COUNT=200 \
COUCHBASE_URL="" \
COUCHBASE_PW="" \
USER_NUMBER_STARTING_POINT=0 \
USER_NUMBER_ENDING_POINT=50000000 \
LOAD_USERS_TO_COUCHBASE=false \
LOAD_USERS_TO_RDBMS=false \
USER_SPLIT_PARALLEL_THREADS=20 \
# pgsql or mysql
Expand Down
3 changes: 0 additions & 3 deletions demos/benchmarking/docker-jans-loadtesting-jmeter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ Installation depends on the set of environment variables shown below. These envi
| ENV | Description | Default |
|----------------------------------|---------------------------------------------------------------------------------------------------------------|------------------------|
| `TEST_USERS_PREFIX_STRING` | The user prefix string attached to the test users loaded | `test_user` |
| `COUCHBASE_URL` | Couchbase URL if Couchbase is the persistence to load users in. | `` |
| `COUCHBASE_PW` | Couchbase PW if Couchbase is the persistence to load users in. | `` |
| `USER_NUMBER_STARTING_POINT` | The user number to start from . This is appended to the username i.e test_user0 | `0` |
| `USER_NUMBER_ENDING_POINT` | The user number to end at. | `50000000` |
| `LOAD_USERS_TO_COUCHBASE` | Enable loading users to Couchbase persistence. `true` or `false` == `` | `false` |
| `LOAD_USERS_TO_RDBMS` | Enable loading users to RDBMS persistence. `true` or `false` == `` | `false` |
| `USER_SPLIT_PARALLEL_THREADS` | The number of parallel threads to break the total number users across. This number heavily effects CPU usage. | `20` |
| `RDBMS_TYPE` | RDBMS type if `mysql` or `pgsql` is the persistence to load users in. | `mysql` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ joblib
pygtail
psycopg2-binary
PyMySQL
# ===============
# Install Couchbase Client
# ===============
couchbase

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#!/bin/bash
set -e

# ================================================================================================ #
# Check if this is a user loading job to the backend couchbase #
# ================================================================================================ #
if [[ "$LOAD_USERS_TO_COUCHBASE" = "true" ]]; then
/usr/bin/python3 /scripts/add_users_couchbase.py
exit 0
# ================================================================================================ #
# Check if this is a user loading job to the backend RDBMS #
# ================================================================================================ #
elif [[ "$LOAD_USERS_TO_RDBMS" = "true" ]]; then
if [[ "$LOAD_USERS_TO_RDBMS" = "true" ]]; then
/usr/bin/python3 /scripts/add_users_rdbm.py
exit 0
fi
Expand Down

This file was deleted.

4 changes: 1 addition & 3 deletions docker-jans-all-in-one/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RUN apk update \
# Assets sync
# ===========

ENV JANS_SOURCE_VERSION=6e00e723a99d700a4f82713b0c25b2d6e3ef5775
ENV JANS_SOURCE_VERSION=871c36da8a2550ee2febd7c0d72c521898b226c3

# note that as we're pulling from a monorepo (with multiple project in it)
# we are using partial-clone and sparse-checkout to get the assets
Expand Down Expand Up @@ -211,8 +211,6 @@ ENV JETTY_BASE=/opt/jans/jetty \
CN_LINK_JAVA_OPTIONS="" \
CN_SHARE_AUTH_CONF=false \
CN_SQL_PASSWORD_FILE=/etc/jans/conf/sql_password \
CN_COUCHBASE_PASSWORD_FILE=/etc/jans/conf/couchbase_password \
CN_COUCHBASE_SUPERUSER_PASSWORD_FILE=/etc/jans/conf/couchbase_superuser_password \
CN_KEYCLOAK_LINK_JETTY_HOST=127.0.0.1 \
CN_KEYCLOAK_LINK_JETTY_PORT=9092 \
CN_KEYCLOAK_LINK_JAVA_OPTIONS="" \
Expand Down
17 changes: 3 additions & 14 deletions docker-jans-auth-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ RUN mkdir -p ${JETTY_BASE}/jans-auth/agama/fl \
/app/static/rdbm \
/app/schema

ENV JANS_SOURCE_VERSION=6e00e723a99d700a4f82713b0c25b2d6e3ef5775
ENV JANS_SOURCE_VERSION=871c36da8a2550ee2febd7c0d72c521898b226c3
ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup

# note that as we're pulling from a monorepo (with multiple project in it)
Expand Down Expand Up @@ -205,18 +205,7 @@ ENV CN_SECRET_ADAPTER=vault \
# ===============

ENV CN_PERSISTENCE_TYPE=sql \
CN_HYBRID_MAPPING="{}" \
CN_COUCHBASE_URL=localhost \
CN_COUCHBASE_USER=admin \
CN_COUCHBASE_CERT_FILE=/etc/certs/couchbase.crt \
CN_COUCHBASE_PASSWORD_FILE=/etc/jans/conf/couchbase_password \
CN_COUCHBASE_CONN_TIMEOUT=10000 \
CN_COUCHBASE_CONN_MAX_WAIT=20000 \
CN_COUCHBASE_SCAN_CONSISTENCY=not_bounded \
CN_COUCHBASE_BUCKET_PREFIX=jans \
CN_COUCHBASE_TRUSTSTORE_ENABLE=true \
CN_COUCHBASE_KEEPALIVE_INTERVAL=30000 \
CN_COUCHBASE_KEEPALIVE_TIMEOUT=2500
CN_HYBRID_MAPPING="{}"

# ===========
# Generic ENV
Expand Down Expand Up @@ -271,7 +260,7 @@ RUN mkdir -p ${JETTY_BASE}/jans-auth/custom/pages \
${JETTY_BASE}/jans-auth/custom/libs \
${JETTY_BASE}/jans-auth/custom/i18n \
${JETTY_BASE}/jans-auth/logs \
${JETTY_BASE}/common/libs/couchbase \
${JETTY_BASE}/common/libs \
${JETTY_HOME}/temp \
/etc/jans/conf \
/app/templates \
Expand Down
27 changes: 8 additions & 19 deletions docker-jans-auth-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,8 @@ The following environment variables are supported by the container:
- `CN_WAIT_SLEEP_DURATION`: Delay between startup "health checks" (default to `10` seconds).
- `CN_MAX_RAM_PERCENTAGE`: Value passed to Java option `-XX:MaxRAMPercentage`.
- `CN_DEBUG_PORT`: port of remote debugging (if omitted, remote debugging will be disabled).
- `CN_PERSISTENCE_TYPE`: Persistence backend being used (one of `couchbase`, `sql`, or `hybrid`; default to `sql`).
- `CN_PERSISTENCE_TYPE`: Persistence backend being used (one of `sql` or `hybrid`; default to `sql`).
- `CN_HYBRID_MAPPING`: Specify data mapping for each persistence (default to `"{}"`). Note this environment only takes effect when `CN_PERSISTENCE_TYPE` is set to `hybrid`. See [hybrid mapping](#hybrid-mapping) section for details.
- `CN_COUCHBASE_URL`: Address of Couchbase server (default to `localhost`).
- `CN_COUCHBASE_USER`: Username of Couchbase server (default to `admin`).
- `CN_COUCHBASE_CERT_FILE`: Couchbase root certificate location (default to `/etc/certs/couchbase.crt`).
- `CN_COUCHBASE_PASSWORD_FILE`: Path to file contains Couchbase password (default to `/etc/jans/conf/couchbase_password`).
- `CN_COUCHBASE_CONN_TIMEOUT`: Connect timeout used when a bucket is opened (default to `10000` milliseconds).
- `CN_COUCHBASE_CONN_MAX_WAIT`: Maximum time to wait before retrying connection (default to `20000` milliseconds).
- `CN_COUCHBASE_SCAN_CONSISTENCY`: Default scan consistency; one of `not_bounded`, `request_plus`, or `statement_plus` (default to `not_bounded`).
- `CN_COUCHBASE_BUCKET_PREFIX`: Prefix for Couchbase buckets (default to `jans`).
- `CN_COUCHBASE_TRUSTSTORE_ENABLE`: Enable truststore for encrypted Couchbase connection (default to `true`).
- `CN_COUCHBASE_KEEPALIVE_INTERVAL`: Keep-alive interval for Couchbase connection (default to `30000` milliseconds).
- `CN_COUCHBASE_KEEPALIVE_TIMEOUT`: Keep-alive timeout for Couchbase connection (default to `2500` milliseconds).
- `CN_AUTH_JAVA_OPTIONS`: Java options passed to entrypoint, i.e. `-Xmx1024m` (default to empty-string).
- `CN_DOCUMENT_STORE_TYPE`: Document store type (one of `LOCAL` or `DB`; default to `DB`).
- `CN_JACKRABBIT_URL`: URL to remote repository (default to `http://localhost:8080`).
Expand Down Expand Up @@ -183,12 +172,12 @@ As per v1.0.1, hybrid persistence supports all available persistence types. To c

```
{
"default": "<couchbase|sql>",
"user": "<couchbase|sql>",
"site": "<couchbase|sql>",
"cache": "<couchbase|sql>",
"token": "<couchbase|sql>",
"session": "<couchbase|sql>",
"default": "<sql>",
"user": "<sql>",
"site": "<sql>",
"cache": "<sql>",
"token": "<sql>",
"session": "<sql>",
}
```

Expand All @@ -200,7 +189,7 @@ As per v1.0.1, hybrid persistence supports all available persistence types. To c
"user": "sql",
"site": "sql",
"cache": "sql",
"token": "couchbase",
"token": "sql",
"session": "sql",
}
```
Expand Down
16 changes: 0 additions & 16 deletions docker-jans-auth-server/scripts/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

from jans.pycloudlib import get_manager
from jans.pycloudlib import wait_for_persistence
from jans.pycloudlib.persistence.couchbase import render_couchbase_properties
from jans.pycloudlib.persistence.couchbase import sync_couchbase_cert
from jans.pycloudlib.persistence.couchbase import sync_couchbase_truststore
from jans.pycloudlib.persistence.couchbase import sync_couchbase_password
from jans.pycloudlib.persistence.hybrid import render_hybrid_properties
from jans.pycloudlib.persistence.sql import render_sql_properties
from jans.pycloudlib.persistence.sql import sync_sql_password
Expand Down Expand Up @@ -47,18 +43,6 @@ def main():
if not os.path.exists(hybrid_prop):
render_hybrid_properties(hybrid_prop)

if "couchbase" in persistence_groups:
sync_couchbase_password(manager)
render_couchbase_properties(
manager,
"/app/templates/jans-couchbase.properties",
"/etc/jans/conf/jans-couchbase.properties",
)

if as_boolean(os.environ.get("CN_COUCHBASE_TRUSTSTORE_ENABLE", "true")):
sync_couchbase_cert(manager)
sync_couchbase_truststore(manager)

if "sql" in persistence_groups:
sync_sql_password(manager)
db_dialect = os.environ.get("CN_SQL_DB_DIALECT", "mysql")
Expand Down
2 changes: 0 additions & 2 deletions docker-jans-auth-server/scripts/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from uuid import uuid4

from jans.pycloudlib import get_manager
from jans.pycloudlib.persistence.couchbase import CouchbaseClient
from jans.pycloudlib.persistence.sql import SqlClient
from jans.pycloudlib.persistence.utils import PersistenceMapper
from jans.pycloudlib.utils import generate_base64_contents
Expand Down Expand Up @@ -98,7 +97,6 @@ def __init__(self, manager) -> None:
self.manager = manager

client_classes = {
"couchbase": CouchbaseClient,
"sql": SqlClient,
}

Expand Down
7 changes: 0 additions & 7 deletions docker-jans-auth-server/scripts/mod_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ def modify_app_xml(app_name):
mapper = PersistenceMapper()
persistence_groups = mapper.groups().keys()

for persistence_type in ["couchbase"]:
if persistence_type not in persistence_groups:
continue

extract_common_libs(persistence_type)
custom_libs += get_registered_common_libs(app_name, persistence_type)

# render custom xml
fn = f"/opt/jans/jetty/{app_name}/webapps/{app_name}.xml"

Expand Down
Loading