You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you deployed the SLURM cluster without setting up the necessary configurations for the IPython Notebook (such as `af3ipynb_bucket`, `slurm_rest_token_secret_name`, or notebook-specific variables), you must tear down the existing SLURM cluster before proceeding.
27
-
28
-
This is required because these configurations are only applied at deployment time. Modifying them after the cluster is live will not properly enable the notebook environment or API integration.
3
+
This guide explains how to deploy and access the Jupyter Notebook environment for AlphaFold **after the af3-slurm.yaml cluster has already been deployed** with SLURM REST support enabled.
29
4
30
-
Run the following command from the cluster-toolkit root directory to destroy the previously deployed SLURM cluster:
31
-
32
-
```bash
33
-
# Make sure you're in the root of the `cluster-toolkit` directory
After tearing down the cluster, you can safely update `af3-slurm-deployment.yaml` with the necessary notebook settings. The next section explains how to make these updates.
39
-
40
-
## Deploying a Jupyter Notebook for AlphaFold
41
-
42
-
You can deploy a Jupyter Notebook environment to run AlphaFold step-by-step. This is useful for interactive exploration and making custom modifications to the AlphaFold pipeline.
43
-
44
-
> **Important:** To enable the Jupyter Notebook deployment, you **must provide a cloud storage bucket**. If no bucket is specified, the notebook environment will not be created.
45
-
46
-
### Enable the SLURM REST API Server
5
+
## Prerequisites
47
6
48
-
Set the `slurm_rest_server_activate` value to `true`in the`af3-slurm-deployment.yaml` file to enable the SLURM REST API server on the controller node of the `af3-slurm.yaml` cluster. This allows the Jupyter Notebook environment to send requests—such as job submissions—to the SLURM scheduler via the REST API.
7
+
Before proceeding, ensure the following configuration values were set correctly in your`af3-slurm-deployment.yaml` file **prior to deploying the SLURM cluster**:
49
8
50
9
```yaml
51
10
slurm_rest_server_activate: true
11
+
slurm_rest_token_secret_name: "<your-secret-name>"# Name of your Secret Manager secret
12
+
af3ipynb_bucket: "<your-pre-existing-bucket-name>"# Existing Cloud Storage bucket name
52
13
```
53
14
54
-
### Configuring the SLURM REST API Token Secret Manager
55
-
56
-
Set `slurm_rest_token_secret_name` value in the `af3-slurm-deployment.yaml` with the name of an existing secret in Secret Manager. Alternatively, you can specify a name for a secret that does not yet exist. If the specified secret name is new, this blueprint will automatically create it for you.
57
-
58
-
> This setting allows you to specify the name of a Google Cloud Secret Manager secret that holds your SLURM authentication token. Using Secret Manager is a secure way to manage sensitive credentials.
> This bucket is used to store notebooks and related files for the Jupyter environment.
73
-
74
-
2. **Deploy the Jupyter Notebook environment** using the `af3-slurm-ipynb.yaml` blueprint:
15
+
> [!WARNING]
16
+
> This guide assumes that the SLURM cluster is already deployed with REST API support enabled—i.e., the values above were correctly set before deployment.
17
+
> If any of the values above were omitted or misconfigured, you must destroy the cluster, update the deployment configuration, and redeploy. These settings are essential for enabling SLURM REST-based notebook functionality.
18
+
> This document focuses exclusively on deploying and accessing the Jupyter Notebook environment **after** the cluster is running and properly configured. It does not cover modifying or redeploying the cluster.
75
19
76
-
```bash
77
-
# Make sure you're in the root of the `cluster-toolkit` directory
If you have **not yet deployed** the cluster, or if you need help setting the appropriate variables prior to deployment, refer to [Setup-pre-cluster-deployment.md](./Setup-pre-cluster-deployment.md) guide.
83
21
84
-
3. **Rebuild the SLURM cluster** using the updated deployment file:
### 1. Upload the required Notebook to the Cloud Storage Bucket
94
25
95
-
## Upload Notebook to Bucket
26
+
First, access the controller node of your deployed SLURM cluster. Replace placeholders `<controller-node-name>` and `<your-zone>` with your actual node and zone.
96
27
97
-
To upload the Jupyter notebook to the cloud storage bucket so it can be accessed via JupyterLab:
On the controller node, run the following command (assuming the `slurm_rest_user` value in `af3-slurm-deployment.yaml` has not changed):
100
33
101
-
2. **Navigate to the setup directory**:
34
+
```bash
35
+
cd /home/af3ipynb/ipynb_setup
36
+
ansible-playbook ipynb-upload-config.yml
37
+
```
102
38
103
-
```bash
104
-
cd /home/af3ipynb/ipynb_setup
105
-
```
39
+
This step uploads the notebook (`slurm-rest-api-notebook.ipynb`) along with its required scripts and libraries to the bucket defined in the `af3ipynb_bucket` variable in `af3-slurm-deployment.yaml` file.
40
+
Make sure that this bucket was created and specified during the SLURM cluster deployment process.
106
41
107
-
3. Run the Ansible playbook to upload the Jupyter notebook and its required library files to the designated bucket:
42
+
### 2. Grant Secret Access to the Notebook's Service Account
108
43
109
-
```bash
110
-
ansible-playbook ipynb-upload-config.yml
111
-
```
44
+
This setting ensures that the notebook server can successfully retrieve the specified secret by name.
45
+
Make sure the service account running the Jupyter Notebook instance (typically the Compute Engine default service account) has permission to access the Secret Manager secret that stores your SLURM REST token.
112
46
113
-
This playbook will upload `slurm-rest-api-notebook.ipynb` along with its associated scripts and library files to the target bucket (`af3ipynb_bucket`).
114
-
Once the upload is complete, you can access the notebook from the JupyterLab interface via:
47
+
The following command grants the Compute Engine default service account the `roles/secretmanager.secretAccessor` role, allowing it to access the specified secret in Secret Manager. The attached condition always evaluates to true, ensuring access is consistently granted.
115
48
116
-
> Cloud Console → Vertex AI → Workbench → Instances
After the deploying steps are success, you must ensure that the appropriate service account (e.g., the default service account for the Compute Engine instance) has permission to access the secret. This step is crucial because, without access to the secret, the notebook will not be able to authenticate properly or send valid requests to the SLURM REST API.
60
+
### 4. Launch the Notebook Environment
123
61
124
-
If you have not granted access yet, then run the following command, replacing `<your-secret-name>` and `<your-project-id>` with your values:
62
+
Deploy the Jupyter Notebook environment using the following command:
This command grants the Compute Engine default service account the `secretAccessor` role with a condition that always evaluates to true, as shown in the image below. You can view this in the `Secret Manager` page in the Google Cloud Console.
### 5. Access the Notebook via Vertex AI Workbench
136
74
137
-
This setting allows the notebook server to successfully retrieve the value of the specified secret by its name.
75
+
In the Google Cloud Console:
138
76
139
-
### Verify Access
77
+
1. Navigate to `Vertex AI` → `Workbench` → `Instances`
140
78
141
-
To confirm that the service account has the necessary permissions, from the jupyter notebook workbench, you can open a terminal and run the following command:
79
+
2. Open the JupyterLab interface for the newly deployed instance
3. Locate and open the `slurm-rest-api-notebook.ipynb` file. If you haven't modified the default value of `af3ipynb_bucket_local_mount` in the `af3-slurm-deployment.yaml`, the notebook should be available at `/home/jupyter/alphafold` folder.
146
82
147
-
If the command succeeds, this confirms that your notebook can securely retrieve the authentication token from Secret Manager as shown in the image below.
You can customize settings via blueprint variables before deployment. If modifications are needed later, ensure:
91
+
If the command returns the secret value successfully, it confirms that the notebook environment can securely access the SLURM REST API—just as in the image below:
154
92
155
-
- All required resources are available
156
-
- Configuration changes within the notebook are validated before submitting new jobs.
If you would like to tear down the notebook deployment, use the command below.
97
+
To remove the Jupyter Notebook deployment when it is no longer needed, run the following command:
161
98
162
99
```bash
163
100
./gcluster destroy af3-slurm-ipynb --auto-approve
@@ -167,3 +104,8 @@ If you would like to tear down the notebook deployment, use the command below.
167
104
> If you do not destroy the Jupyter Notebook deployment, it may continue to incur costs.
168
105
> Additionally, any Cloud Storage buckets you created (via the CLI or console) will not be automatically deleted. You are responsible for cleaning them up manually to avoid unnecessary charges.
169
106
> For deleting the buckets consult [Delete buckets](https://cloud.google.com/storage/docs/deleting-buckets).
107
+
108
+
## Notes and Customization
109
+
You can adjust the notebook setup behavior using blueprint variables in the deployment YAML.
110
+
All configurations should be validated before running jobs.
111
+
If further modifications to SLURM REST/API Server behavior are required, you must destroy and redeploy the cluster with the updated settings.
0 commit comments