Working with Amazon SageMaker#
To track runs and log metadata to Neptune, take the following steps in your Amazon SageMaker environment:
- In the left pane, under Notebook, select Lifecycle configurations.
- Click Create configuration.
- Enter a name for your lifecycle configuration (you'll need it in step 7).
- Modify the Create notebook script to run it once at the creation of your SageMaker Notebook instance.
Copy-paste the following to the Create notebook script:
PARAMETERSsection, specify in which environments you want to install the Neptune client library (neptune-client).
#!/bin/bash set -e sudo -u ec2-user -i <<'EOF' # PARAMETERS ENVS=( python3 pytorch_p36 ) # Install Neptune client library for env in $ENVS; do source /home/ec2-user/anaconda3/bin/activate $env pip install neptune-client source /home/ec2-user/anaconda3/bin/deactivate done # Install Jupyter extension source /home/ec2-user/anaconda3/bin/activate JupyterSystemEnv pip install neptune-notebooks jupyter nbextension enable --py neptune-notebooks --sys-prefix jupyter labextension install neptune-notebooks source /home/ec2-user/anaconda3/bin/deactivate EOF
In the left pane, select Notebook instances and click Create notebook instance.
- Type in an instance name and click Additional configuration to add the lifecycle configuration you just created.
- To start your instance, click Create notebook instance.
If everything was set up correctly, the status of your Amazon SageMaker instance should be "InService".
You can open a Jupyter Notebook or JupyterLab with Neptune notebook versioning enabled.