cd citycat-image
DOCKER_BUILDKIT=1 docker build --tag=citycat-image:latest .
Note: Make sure you are in the correct directory when you try to build the image.
Note: You need to download the CityCat.exe and Domain_DESC.asc from the buckets before running the image.
The following mounts the 3 local directories and uses the default environment variables and entry point.
docker run -it -v $(pwd)/climateiq-flood-simulation-input:/mnt/disks/share/climateiq-flood-simulation-input -v $(pwd)/climateiq-flood-simulation-output:/mnt/disks/share/climateiq-flood-simulation-output -v $(pwd)/climateiq-flood-simulation-config:/mnt/disks/share/climateiq-flood-simulation-config citycat-image:latest
CityCat is running correctly if you see something like the following:
0024:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0024:err:winediag:nodrv_CreateWindow L"Make sure that your X server is running and that $DISPLAY is set correctly."
--------------------------------------------------------
CityCat, version 6.4.11.7852, written by vassilis glenis
--------------------------------------------------------
Pass the command a -e
flag.
docker run -it -e CITYCAT_CONFIG_FILE=2 -e RAINFALL_DATA_FILE=2 -e STUDY_AREA=manhattan -e CONFIG=config_1 -v $(pwd)/citycat-input-test:/mnt/disks/share/citycat-input-test -v $(pwd)/citycat-output-test:/mnt/disks/share/citycat-output-test -v $(pwd)/citycat-config-test:/mnt/disks/share/citycat-config-test citycat-image:latest
If you want to debug, it might be helpful to enter the container and override the entrypoint script by adding the flag --entrypoint
.
docker run -it --entrypoint bash -v $(pwd)/climateiq-flood-simulation-input:/mnt/disks/share/climateiq-flood-simulation-input -v $(pwd)/climateiq-flood-simulation-output:/mnt/disks/share/climateiq-flood-simulation-output -v $(pwd)/climateiq-flood-simulation-config:/mnt/disks/share/climateiq-flood-simulation-config citycat-image:latest
To exit the container, type exit
.
If you make any changes to the Dockerfile or execute.sh script, you need to rebuild the image to see the changes.
Verify the image was created
``` docker images citycat-image ```- [If it does not already exist] Create the artifact repository
- Build the image
- Tag and push the image to the artifact repository
Authorize via gcloud cli
PROJECT_ID=climateiq-test
gcloud auth login
gcloud config set project ${PROJECT_ID}
Running the following script creates the repository: citycat-repo
chmod +x ../artifact_repository/create.sh
../artifact_repository/create.sh
To verify repo was created
``` gcloud artifacts repositories list ```To delete a repo (if you want to change the name or create a new one)
``` gcloud artifacts repositories delete citycat-repo --location=us-central1 ```Alternatively, you can use the terraform to create the repository.
Using the steps above in building the image locally
Running the following script tags and pushes the image
chmod +x ../artifact_repository/submit.sh
PROJECT_ID="climateiq-test" ../artifact_repository/submit.sh
Verify the project id is correct depending on what project you want to use
If you are getting denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "X"
, make sure the project id (PROJECT_ID) env variable is set to the correct one.
You can also try the following
gcloud config set project ${PROJECT_ID}
gcloud auth login application-default
gcloud auth configure-docker ${LOCATION}-docker.pkg.dev