#!/bin/bash

{% for bucket_mount in bucket_mounts %}
sudo mkdir -p {{ bucket_mount["mount_path"] }}/{{ bucket_mount["bucket_name"] }}
sudo chmod -R 777 {{ bucket_mount["mount_path"] }}/{{ bucket_mount["bucket_name"] }}
sudo su - jupyter -c "gcsfuse --implicit-dirs {{ bucket_mount["bucket_name"] }} {{ bucket_mount["mount_path"] }}/{{ bucket_mount["bucket_name"] }}"
{% endfor %}

{% if tensorboard_resource_name is not none %}
export AIP_TENSORBOARD_LOG_DIR={{ tensorboard_resource_name }}
{% endif %}