Skip to content

Instantly share code, notes, and snippets.

@hariby
Last active November 7, 2019 05:08
Show Gist options
  • Save hariby/822af5e7e0a20c108b65b045466b8ccc to your computer and use it in GitHub Desktop.
Save hariby/822af5e7e0a20c108b65b045466b8ccc to your computer and use it in GitHub Desktop.
Install Blueqat and Qgate to conda_python3 kernel when starting a SageMaker Notebook instance.
#!/bin/bash
set -e
# OVERVIEW
# This script installs a single pip package in a single SageMaker conda environments.
# Slightly modified from https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/blob/master/scripts/install-pip-package-single-environment/on-start.sh
sudo -u ec2-user -i <<'EOF'
# PARAMETERS
PACKAGE=blueqat
ENVIRONMENT=python3
source /home/ec2-user/anaconda3/bin/activate "$ENVIRONMENT"
pip install "$PACKAGE"
wget https://github.com/shinmorino/qgate/raw/gh-pages/packages/0.2/qgate-0.2.1-cp36-cp36m-manylinux1_x86_64.whl
pip install qgate-0.2.1-cp36-cp36m-manylinux1_x86_64.whl
source /home/ec2-user/anaconda3/bin/deactivate
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment