Skip to content

Commit

Permalink
Merge pull request #5 from radicalbit/feature/ROS-355-add-quickstarts…
Browse files Browse the repository at this point in the history
…-demo-models

feat: add minio mirror and init data containers in docker
  • Loading branch information
dtria91 authored Jul 16, 2024
2 parents 961ae6d + df805fa commit 1b7eff1
Show file tree
Hide file tree
Showing 10 changed files with 14,026 additions and 1 deletion.
4 changes: 3 additions & 1 deletion radicalbit_ai_monitoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"postgres": "postgres:15.7-alpine",
"minio": "minio/minio:latest",
"createbuckets": "minio/mc:latest",
"init-data": "postgres:15.7-alpine",
"minio-mirror": "minio/minio:latest",
"k3s": "rancher/k3s:v1.30.1-k3s1",
}

Expand All @@ -27,6 +29,6 @@
OSS_REPO = "https://github.com/radicalbit/radicalbit-ai-monitoring"
OSS_REPO_API = "https://api.github.com/repos/radicalbit/radicalbit-ai-monitoring"

AVAILABLE_VERSIONS = ["latest", "v0.8.2"]
AVAILABLE_VERSIONS = ["latest", "v0.9.0", "v0.8.2"]

RADICALBIT_FIGLET = "Radicalbit AI Monitoring"
35 changes: 35 additions & 0 deletions radicalbit_ai_monitoring/resources/docker-compose-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ services:
condition: service_completed_successfully
createbuckets:
condition: service_completed_successfully
k3s:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "curl -s http://localhost:9000/healthcheck" ]
interval: 5s
Expand Down Expand Up @@ -96,6 +98,33 @@ services:
exit 0;
"
init-data:
image: postgres:15.7-alpine
depends_on:
migrations:
condition: service_completed_successfully
environment:
POSTGRES_DB: radicalbit
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- ./docker/init-data/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
entrypoint: >
/bin/sh -c "
sleep 10;
PGPASSWORD=postgres psql -h postgres -U postgres -d radicalbit -f /docker-entrypoint-initdb.d/init_db.sql;
"
minio-mirror:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: /bin/sh /scripts/mirror_files.sh
volumes:
- ./docker/init-data/mirror_files.sh:/scripts/mirror_files.sh
- ./docker/init-data/quickstarts/data:/data

k3s:
image: rancher/k3s:v1.30.1-k3s1
networks:
Expand Down Expand Up @@ -129,6 +158,12 @@ services:
- "443" # Ingress controller port 443
ports:
- 6443:6443
healthcheck:
test: [ "CMD-SHELL", "netstat -tuln | grep ':6443 ' || exit 1" ]
interval: 10s
timeout: 5s
start_period: 5s
retries: 2

volumes:
rbit-k3s-server: {}
Expand Down
29 changes: 29 additions & 0 deletions radicalbit_ai_monitoring/resources/docker/init-data/init_db.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# Set the MinIO alias
/usr/bin/mc alias set myminio http://minio:9000 minio minio123

# Create the test-bucket bucket if it doesn't exist
/usr/bin/mc mb myminio/test-bucket

# Copy files from the project root to the correct paths in the MinIO bucket
/usr/bin/mc cp /data/binary_classification/reference-income.csv myminio/test-bucket/e02f2aed-cd29-4703-8faf-2dcab9fc668e/reference/ee43cc3d-d71c-43f2-be0b-55da73d509c5/
/usr/bin/mc cp /data/binary_classification/current1-income.csv myminio/test-bucket/e02f2aed-cd29-4703-8faf-2dcab9fc668e/current/63b173f8-6150-41f5-8a6b-a1e08a3a7c12/
/usr/bin/mc cp /data/multiclass-classification/3_classes_reference.csv myminio/test-bucket/756204a0-a6ba-44c2-b287-ca828e2b2441/reference/dd84c147-f6aa-4584-a2dc-3ca4cd00917b/
/usr/bin/mc cp /data/multiclass-classification/3_classes_current1.csv myminio/test-bucket/756204a0-a6ba-44c2-b287-ca828e2b2441/current/658f7c87-b557-4611-a29e-9ae0ae42ded7/
/usr/bin/mc cp /data/regression/regression_abalone_reference.csv myminio/test-bucket/6c48c7e1-442b-4c48-a218-95d07f40a805/reference/12fbe35a-3530-4e26-b53b-ee12dc47a874/
/usr/bin/mc cp /data/regression/regression_abalone_current1.csv myminio/test-bucket/6c48c7e1-442b-4c48-a218-95d07f40a805/current/03616777-0b1e-47ed-b1ad-273dc51d467d/

# Exit the script
exit 0

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 1b7eff1

Please sign in to comment.