Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/terraform-google-modules/terraform-google-datalab
Creates DataLab instances with support for GPU instances
https://github.com/terraform-google-modules/terraform-google-datalab
cft-terraform data-analytics
Last synced: 13 days ago
JSON representation
Creates DataLab instances with support for GPU instances
- Host: GitHub
- URL: https://github.com/terraform-google-modules/terraform-google-datalab
- Owner: terraform-google-modules
- License: apache-2.0
- Created: 2019-07-19T01:30:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-19T17:09:36.000Z (22 days ago)
- Last Synced: 2024-12-19T18:23:20.468Z (22 days ago)
- Topics: cft-terraform, data-analytics
- Language: HCL
- Homepage: https://registry.terraform.io/modules/terraform-google-modules/datalab/google
- Size: 184 KB
- Stars: 6
- Watchers: 19
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Google Datalab Terraform Module
Use [Cloud Datalab](https://cloud.google.com/datalab/) to easily explore, visualize, analyze, and transform data using familiar languages, such as Python and SQL, interactively.
## Compatibility
This module is meant for use with Terraform 0.13. If you haven't
[upgraded](https://www.terraform.io/upgrade-guides/0-13.html) and need a Terraform
0.12.x-compatible version of this module, the last released version
intended for Terraform 0.12.x is [v1.0.0](https://registry.terraform.io/modules/terraform-google-modules/-datalab/google/v1.0.0).## Usage
Basic usage of this module is as follows:
```hcl
module "datalab" {
source = "terraform-google-modules/datalab/google//modules/instance"
version = "~> 1.0"
project_id = ""
zone = "us-central1-c"
datalab_user_email = "
network_name = "datalab-network"
subnet_name = "datalab-subnetwork"
}
```Functional examples are included in the
[examples](./examples/) directory.## Requirements
These sections describe requirements for using this module.
### Software
The following dependencies must be available:
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.0
- [Terraform Provider for GCP][terraform-provider-gcp] plugin >= 3.53### Service Account
A service account with the following minimum roles must be used to provision
the resources of this module:- Compute Instance Admin: `roles/compute.instanceAdmin` (create instance)
- Compute Security Admin: `roles/compute.securityAdmin` (create firewall rule)
- Service Account User: `roles/iam.serviceAccountUser` (access service account)If using the examples you will need these additional roles.
- Compute Network Admin: `roles/compute.networkAdmin` (create VPC)Advance Example
- Service Account Admin: `roles/iam.serviceAccountAdmin` (create service account)
- Projects IAM Admin: `roles/resourcemanager.projectIamAdmin` (set IAM policy on project)### Service Account for instance
The service account for the datalab instances will need the permission `compute.instances.stop` in order to allow the idle timeout option to shutdown the instance.
### APIs
A project with the following APIs enabled must be used to host the
resources of this module:- Compute Engine API : `compute.googleapis.com`
- Identity and Access Management API : `iam.googleapis.com`
- Cloud Resource Manager API: `cloudresourcemanager.googleapis.com`## Contributing
Refer to the [contribution guidelines](./CONTRIBUTING.md) for
information on contributing to this module.[iam-module]: https://registry.terraform.io/modules/terraform-google-modules/iam/google
[project-factory-module]: https://registry.terraform.io/modules/terraform-google-modules/project-factory/google
[terraform-provider-gcp]: https://www.terraform.io/docs/providers/google/index.html
[terraform]: https://www.terraform.io/downloads.html# Access the Cloud Datalab UI
Setup tunnel to the Datalab UI
```
gcloud beta compute start-iap-tunnel INSTANCE_NAME 8080 \
--project PROJECT \
--zone ZONE \
--local-host-port=localhost:8080
```
Using your browser go to http://localhost:8080# GPU instances
Not all GPU types are supported in all zones. Go here to check which GPU type and zones are supported https://cloud.google.com/compute/docs/gpus/The Datalab GPU instance will take a few more minutes to come up since it needs to install the NVIDIA Accelerated Graphics Driver
To verify that the drivers are installed correctly and the instance has the correct number of GPUs run:
`/var/lib/nvidia/bin/nvidia-smi`