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

Fixes #13, Update Server Configuration #14

Merged
merged 5 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 7 additions & 7 deletions bin/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ else
echo "WARNING: File $ENV_FILE does not exist, relying on environment variables"
fi

REQUIRED_ENVIRONMENT_VARIABLES="LOUIS_DSN PGBASE PGUSER PGPASSWORD PGHOST OPENAI_API_KEY AZURE_OPENAI_SERVICE LOUIS_SCHEMA"
for VARIABLE in $REQUIRED_ENVIRONMENT_VARIABLES; do
if [ -z "${!VARIABLE}" ]; then
echo "Environment variable $VARIABLE is not set"
exit 1
fi
done
# REQUIRED_ENVIRONMENT_VARIABLES="LOUIS_DSN PGBASE PGUSER PGPASSWORD PGHOST OPENAI_API_KEY AZURE_OPENAI_SERVICE LOUIS_SCHEMA"
# for VARIABLE in $REQUIRED_ENVIRONMENT_VARIABLES; do
# if [ -z "${!VARIABLE}" ]; then
# echo "Environment variable $VARIABLE is not set"
# exit 1
# fi
# done
rngadam marked this conversation as resolved.
Show resolved Hide resolved

export PGOPTIONS="--search_path=$LOUIS_SCHEMA,public"
export PGBASE
Expand Down
3 changes: 3 additions & 0 deletions bin/postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ fi
STATUS=`docker inspect louis-db-server -f '{{.State.Status}}'`

if [ "$STATUS" = "exited" ]; then
echo container exist but as exited, restarting
rngadam marked this conversation as resolved.
Show resolved Hide resolved
docker start louis-db-server
elif [ "$STATUS" != "running" ]; then
# check PGPASWORD before using it
echo container does not exist, creating
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update here today

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more details in your string, including container name

docker run --name louis-db-server \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be using your environment variable...

-e POSTGRES_PASSWORD=$PGPASSWORD \
--network louis_network \
Expand Down
2 changes: 1 addition & 1 deletion bin/setup-db-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ -z "$PGBASE" ]; then
exit 1
fi
DOCKER_EXEC="docker exec -it louis-db-server"
rngadam marked this conversation as resolved.
Show resolved Hide resolved
$DOCKER_EXEC createdb -E utf-8 $PGBASE
$DOCKER_EXEC createdb -E utf-8 -U postgres $PGBASE
rngadam marked this conversation as resolved.
Show resolved Hide resolved
$DOCKER_EXEC $PSQL_ADMIN -c "CREATE USER $USER; ALTER USER $USER WITH SUPERUSER;"
JolanThomassin marked this conversation as resolved.
Show resolved Hide resolved
$DOCKER_EXEC pip install pgxnclient
$DOCKER_EXEC pgxn install vector
Expand Down