Skip to content

Commit

Permalink
Update layout
Browse files Browse the repository at this point in the history
  • Loading branch information
shiroinekotfs committed Jul 12, 2024
1 parent 28c35e6 commit a117007
Show file tree
Hide file tree
Showing 18 changed files with 1,381 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* eol=lf
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.pid
*.exe
*.out
*.bin
*cookie_secret*
29 changes: 29 additions & 0 deletions .global/copy-configs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

echo -e "Copying configurations"
mkdir /etc/jupyter/

# Create cookie secret file and proxy authenticator
echo -e "Creating authenticator"
touch /etc/jupyter/proxy_auth_token
chown :sudo /etc/jupyter/proxy_auth_token
chmod g+rw /etc/jupyter/proxy_auth_token
openssl rand -hex 32 > /etc/jupyter/proxy_auth_token
touch /etc/jupyter/jupyterhub_cookie_secret
chown :sudo /etc/jupyter/jupyterhub_cookie_secret
chmod g+rw /etc/jupyter/jupyterhub_cookie_secret
openssl rand -hex 32 > /etc/jupyter/jupyterhub_cookie_secret
chmod 600 /etc/jupyter/jupyterhub_cookie_secret
chmod 600 /etc/jupyter/proxy_auth_token

echo -e "Installing Login Web Templates..."
rmdir --ignore-fail-on-non-empty /usr/local/share/jupyterhub/static
rmdir --ignore-fail-on-non-empty /usr/local/share/jupyterhub/templates
mkdir /usr/local/share/jupyterhub/static
mkdir /usr/local/share/jupyterhub/templates
cp -TRv ./.global/web-portal/hub-login /usr/local/share/jupyterhub

echo -e "Coping tutorial notebooks into global folder..."
mkdir /etc/jupyter/tutorials-notebooks
cp -TRv ./.global/tutorials-notebooks /etc/jupyter/tutorials-notebooks
chmod 740 /etc/jupyter/tutorials-notebooks
27 changes: 27 additions & 0 deletions .global/install_pip_npm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

echo -e "Installing NPM Packages"
npm install -g configurable-http-proxy npm@10.8.2

echo -e "Installing pre-builds"
pip install --upgrade pip setuptools wheel manimlib pycairo
pip install -r ./.global/pip_packages.txt

echo -e "Installing IBM-Q Packages"
python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibm_q_lab_server_extension
python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibm_q_lab_ui_extensions
python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibm_quantum_widgets
python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/ibmq_jupyter_server_health_ext
python3 -m build --verbose --wheel --outdir ./.global/ext-pkg --skip-dependency-check --no-isolation ./.global/ext-pkg/ibm-q-labs/qiskit-kernel
pip install ./.global/ext-pkg/*.whl --ignore-installed --no-deps

echo -e "Disabling the classic mode"
jupyter lab build
jupyter labextension enable @jupyterlab/extensionmanager-extension
jupyter labextension enable @jupyterlab/help-extension:launch-classic
jupyter labextension update --all

echo -e "Cleaning up caches..."
apt autoremove -y
apt-get clean
pip cache purge
Loading

0 comments on commit a117007

Please sign in to comment.