Skip to content

Commit

Permalink
Update the auth notebook to use a single script to set up the env
Browse files Browse the repository at this point in the history
  • Loading branch information
mrakitin committed Jun 13, 2023
1 parent 085dcd8 commit 2e5ca3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions examples/system/get_authentication_params.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@
"metadata": {},
"outputs": [],
"source": [
"ACCOUNT_ID = AUTH_TOKEN = MATERIALS_PROJECT_API_KEY = ORGANIZATION_ID = ''\n",
"import os, glob, sys, importlib, urllib.request\n",
"# !curl \"https://raw.githubusercontent.com/Exabyte-io/api-examples/dev/scripts/env.sh\" | bash\n",
"\n",
"# The below execution sets up runtime using code stored remotely\n",
"!git clone https://github.com/Exabyte-io/api-examples && cd api-examples && git checkout dev\n",
"%run -i api-examples/examples/utils/initialize_settings.py"
"!GIT_BRANCH=\"bugfix/SOF-5578-WIP2\"; export GIT_BRANCH; curl \"https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh\" | bash"
]
},
{
Expand All @@ -60,7 +57,6 @@
"metadata": {},
"outputs": [],
"source": [
"%cd ..\n",
"from settings import HOST, PORT, VERSION, SECURE\n",
"from utils.generic import display_JSON\n",
"\n",
Expand Down
3 changes: 2 additions & 1 deletion scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GIT_BRANCH="${GIT_BRANCH:-'dev'}"
git clone https://github.com/Exabyte-io/api-examples.git --single-branch --branch ${GIT_BRANCH}

python -m pip install -r api-examples/requirements-colab.txt
python -m pip install ./api-examples/utils/
python -m pip install ./api-examples/examples/

# TODO: consider removing it for Colab?
# python api-examples/examples/utils/initialize_settings.py # the script with cd into the current notebook dir

0 comments on commit 2e5ca3c

Please sign in to comment.