proppy / rad-lab

Apache License 2.0
12 stars 7 forks source link

inject project specific information to the notebook environment #14

Open proppy opened 2 years ago

proppy commented 2 years ago

Currently we hardcode a lot of project specific information in the first cell of the tuning notebook: https://github.com/proppy/rad-lab/blob/tuning/modules/silicon_design/scripts/build/notebooks/examples/digital/serv/tuning.md#define-project-parameters

it would be nice to inject them as environment variable instead in the container environment:

CONTAINER_IMAGE = 'us-east4-docker.pkg.dev/catx-demo-radlab/containers/silicon-design-ubuntu-2004:latest'
STAGING_BUCKET='catx-demo-radlab-staging'
PROJECT_ID = 'catx-demo-radlab'
LOCATION = 'us-central1'
MACHINE_TYPE = 'n1-standard-8'
PiotrZierhoffer commented 2 years ago

Some of these would make sense to be "current" settings - we're using the same container image, project id, probably location as the one that the tuning notebook is running in.

This would make it much easier to clone and deploy in your own project, just by adjusting the terraform files. I don't know if it's possible though.

proppy commented 2 years ago

It doesn't seems that the terraform provider: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/notebooks_instance#container_image nor the underlying API: https://cloud.google.com/vertex-ai/docs/workbench/reference/rest/v1beta1/projects.locations.instances#Instance supports specifying the runtime environment of the notebook.

But we should be able to inject this in the container environment by using https://docs.docker.com/engine/reference/builder/#arg