Skip to content

Commit

Permalink
Merge pull request #284
Browse files Browse the repository at this point in the history
[GitHub Action] Make sure CI tests cover all components
  • Loading branch information
pvannierop authored Jul 10, 2024
2 parents 18d50d9 + 9b48375 commit aeae40f
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 168 deletions.
57 changes: 57 additions & 0 deletions .github/ci_config/ci-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
atomicInstall: false
base_timeout: 180

elasticsearch:
resources:
requests:
cpu: "100m"
memory: "500Mi"

kafka_manager:
_install: false

confluent_cloud:
enabled: false

cp_kafka:
persistence:
size: 1Gi

postgresql:
primary:
resources:
requests:
cpu: 50m
persistence:
size: 1Gi

radar_appserver_postgresql:
primary:
resources:
requests:
cpu: 50m
persistence:
size: 1Gi

timescaledb:
primary:
resources:
requests:
cpu: 50m
persistence:
size: 1Gi

minio:
persistence:
size: 1Gi

radar_upload_postgresql:
primary:
resources:
requests:
cpu: 50m
persistence:
size: 1Gi

ccSchemaRegistryProxy:
_install: false
166 changes: 0 additions & 166 deletions .github/ci_config/install-all.yaml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ jobs:
run: |
./.github/ci_config/bin/install-dependencies
- name: Prepare the environment
- name: Prepare the environment (add secrets and enable installation of all components)
run: |
DNAME='CN=CI,O=TheHyve,L=Utrecht,C=NL' ./bin/init
yq -i -f process '.environments.default.values += ["../.github/ci_config/install-all.yaml", "../.github/ci_config/secrets.yaml.gotmpl"]' environments.yaml
yq -i -f process '.environments.default.values += ["../.github/ci_config/ci-config.yaml", "../.github/ci_config/secrets.yaml.gotmpl"]' environments.yaml
sed -i '/_install: /s/false/true/' etc/production.yaml
- name: Run helmfile template
env:
Expand Down
48 changes: 48 additions & 0 deletions etc/timescaledb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,59 @@ primary:
## - name: FOO
## value: "bar"
##
initdb:
## @param primary.initdb.scripts Dictionary of initdb scripts
## Specify dictionary of scripts to be run at first boot
## e.g:
## scripts:
## my_init_script.sh: |
## #!/bin/sh
## echo "Do something."
##
scripts:
multi-db-init.sh: |
#!/bin/bash
set -e
set -u
export PGPASSWORD="$POSTGRESQL_PASSWORD"
function create_user_and_database() {
export PGPASSWORD="$POSTGRESQL_PASSWORD"
local database=$1
local database_exist=$(psql -U postgres -tAc "SELECT 1 FROM pg_database WHERE datname='$database';")
if [[ "$database_exist" == 1 ]]; then
echo "Database $database already exists"
else
echo "Database $database does not exist"
echo " Creating database '$database' for user postgres"
psql -U postgres -v ON_ERROR_STOP=1 <<-EOSQL
CREATE DATABASE "$database";
GRANT ALL PRIVILEGES ON DATABASE $database TO postgres;
EOSQL
fi
}
if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
#waiting for postgres
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
create_user_and_database $db
done
echo "Databases created"
fi
## @param primary.extraEnvVars Array with extra environment variables to add to PostgreSQL Primary nodes
## e.g:
## extraEnvVars:
## - name: FOO
## value: "bar"
##
extraEnvVars:
- name: POSTGRESQL_USERNAME
value: postgres
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_MULTIPLE_DATABASES
value: grafana,data-dashboard
## @param primary.podAnnotations Map of annotations to add to the pods (postgresql primary)
##
podAnnotations:
Expand Down

0 comments on commit aeae40f

Please sign in to comment.