Set up the minio ql db
- Set up the minio ql db - Use bind mounts in docker compose to get persistence - Populate the ql db with the sample DBs
This commit is contained in:
committed by
=Michael Hohn
parent
8df9673897
commit
bbb54caaf3
10
.gitignore
vendored
10
.gitignore
vendored
@@ -3,3 +3,13 @@ cmd/server/var/
|
|||||||
|
|
||||||
# vscode project dir
|
# vscode project dir
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
|
# Compiled binary
|
||||||
|
cmd/server/server
|
||||||
|
|
||||||
|
# host storage for container
|
||||||
|
minio-data/
|
||||||
|
postgres-data/
|
||||||
|
|
||||||
|
# Scratch space
|
||||||
|
scratch/
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -158,3 +158,19 @@ The steps:
|
|||||||
owner | repo
|
owner | repo
|
||||||
-------+---------
|
-------+---------
|
||||||
foo | foo/bar
|
foo | foo/bar
|
||||||
|
|
||||||
|
### Use the minio ql db
|
||||||
|
|
||||||
|
1. Web access via
|
||||||
|
|
||||||
|
open http://localhost:9001/login
|
||||||
|
|
||||||
|
username / password are in `docker-compose.yml` for now. The ql db listing
|
||||||
|
will be at
|
||||||
|
|
||||||
|
http://localhost:9001/browser/qldb
|
||||||
|
|
||||||
|
1. The names use `owner_repo` format for now, e.g. `google_flatbuffers_db.zip`.
|
||||||
|
TODO This will be enhanced to include other data later
|
||||||
|
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ services:
|
|||||||
POSTGRES_PASSWORD: examplepass
|
POSTGRES_PASSWORD: examplepass
|
||||||
POSTGRES_DB: exampledb
|
POSTGRES_DB: exampledb
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- ./postgres-data:/var/lib/postgresql/data
|
||||||
- ./postgres-init-scripts:/docker-entrypoint-initdb.d
|
- ./postgres-init-scripts:/docker-entrypoint-initdb.d
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432" # Exposing PostgreSQL to the host
|
- "5432:5432" # Exposing PostgreSQL to the host
|
||||||
@@ -33,17 +33,17 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
image: server-image
|
image: server-image
|
||||||
container_name: server
|
container_name: server
|
||||||
|
stop_grace_period: 1s # Reduce the timeout period for testing
|
||||||
environment:
|
environment:
|
||||||
- MRVA_SERVER_ROOT=/mrva/mrvacommander/cmd/server
|
- MRVA_SERVER_ROOT=/mrva/mrvacommander/cmd/server
|
||||||
command: sh -c "tail -f /dev/null"
|
command: sh -c "tail -f /dev/null"
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- /Users/hohn/work-gh/mrva/mrvacommander:/mrva/mrvacommander
|
- ./:/mrva/mrvacommander
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- rabbitmq
|
- rabbitmq
|
||||||
@@ -58,15 +58,17 @@ services:
|
|||||||
- "9001:9001"
|
- "9001:9001"
|
||||||
environment:
|
environment:
|
||||||
MINIO_ROOT_USER: user
|
MINIO_ROOT_USER: user
|
||||||
MINIO_ROOT_PASSWORD: musty-coke
|
MINIO_ROOT_PASSWORD: mmusty8432
|
||||||
|
|
||||||
command: server /data --console-address ":9001"
|
command: server /data --console-address ":9001"
|
||||||
volumes:
|
volumes:
|
||||||
- minio-data:/data
|
- ./minio-data:/data
|
||||||
|
|
||||||
volumes:
|
# Remove named volumes to use bind mounts
|
||||||
minio-data:
|
# volumes:
|
||||||
postgres_data:
|
# minio-data:
|
||||||
driver: local
|
# postgres_data:
|
||||||
|
# driver: local
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
backend:
|
backend:
|
||||||
|
|||||||
28
populate-qldb-store.sh
Normal file
28
populate-qldb-store.sh
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
MINIO_ALIAS="qldbminio"
|
||||||
|
MINIO_URL="http://localhost:9000"
|
||||||
|
MINIO_ROOT_USER="user"
|
||||||
|
MINIO_ROOT_PASSWORD="mmusty8432"
|
||||||
|
BUCKET_NAME="qldb"
|
||||||
|
|
||||||
|
# Check for MinIO client
|
||||||
|
if ! command -v mc &> /dev/null
|
||||||
|
then
|
||||||
|
echo "MinIO client (mc) not found. "
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Configure MinIO client
|
||||||
|
mc alias set $MINIO_ALIAS $MINIO_URL $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD
|
||||||
|
|
||||||
|
# Create ql db bucket
|
||||||
|
mc mb $MINIO_ALIAS/$BUCKET_NAME
|
||||||
|
|
||||||
|
# Upload the two sample DBs
|
||||||
|
mc cp cmd/server/codeql/dbs/google/flatbuffers/google_flatbuffers_db.zip \
|
||||||
|
cmd/server/codeql/dbs/psycopg/psycopg2/psycopg_psycopg2_db.zip \
|
||||||
|
$MINIO_ALIAS/$BUCKET_NAME
|
||||||
|
|
||||||
|
# Check new diskuse
|
||||||
|
du -k minio-data
|
||||||
Reference in New Issue
Block a user