Inspired by "After Dinner Amusements: Which Would You Choose?: 50 Amusing Dilemmas".
-
Clone the repository
-
SSH:
git clone [email protected]:lucasvmigotto/dilemanator.git
-
HTTPS:
git clone https://github.com/lucasvmigotto/dilemanator.git
-
-
Copy the file
.env.example
and rename it to.env
In order to make the application functional, you must inform values for
APP__MODEL_APIKEY
andAPP__DILEMAS_SAMPLES_URL
Customize, if needed, the additional inner values
-
Run the following command:
streamlit run src/main.py \ --server.headless True \ --browser.gatherUsageStats False \ --server.address "$APP__HOST" \ --server.port "$APP__PORT" # --server.runOnSave True
Uncomment
--server.runOnSave True
to enable hot reload
- Run the following command to build the image
GCP_PROJECT_ID='<GCloud Project Id>'
GCP_REPOSITORY_NAME='<Artifact repository name>'
IMAGE_NAME='dilemanator'
CONTAINER_REPOSITORY="us-central1-docker.pkg.dev/${GCP_PROJECT_ID}/${GCP_REPOSITORY_NAME}"
TAG="$(git describe --tags --abbrev=0)"
CONTAINER_PUSH_NAME="${CONTAINER_REPOSITORY}/${IMAGE_NAME}:${TAG}"
docker build \
--tag "${CONTAINER_PUSH_NAME}" \
-f Dockerfile \
--progress plain \
--no-cache \
.
-
Create a container to test the builded image:
docker run \ --rm \ --name "test_container" \ --publish 8080:8080 \ --env APP__DILEMAS_SAMPLES_URL="<Dilemas samples URL>" \ --env APP__MODEL_APIKEY="<Gemini API Key>" \ "${CONTAINER_PUSH_NAME}"
-
Check the prerequisites:
-
Publish the builded image in Artifact Registry
docker push "${CONTAINER_PUSH_NAME}"
- Adjust workflow to use created dilemas history in prompt;
- Setup CI/CD with Google Cloud Artifact Registry and Google Cloud Cloud Run.