Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test local development of crud-web-apps/jupyter #46

Closed
saffaalvi opened this issue Feb 19, 2021 · 2 comments
Closed

Test local development of crud-web-apps/jupyter #46

saffaalvi opened this issue Feb 19, 2021 · 2 comments
Assignees

Comments

@saffaalvi
Copy link

In order to push features upstream, need to be able to locally run the Jupyter Web App in crud-web-apps to see if added features are working properly.

@saffaalvi saffaalvi added the size/M 2-3 days label Feb 19, 2021
@saffaalvi saffaalvi self-assigned this Feb 19, 2021
@saffaalvi
Copy link
Author

saffaalvi commented Feb 19, 2021

You can follow the README but a few adaptation where needed. Friendlier steps below:
Requirements:

  • node 12.0.0
  • min python 3.7

git clone https://github.com/StatCan/kubeflow.git

cd kubeflow

git checkout angular-ngx-translate

Frontend

# build the common library
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
npm i
npm run build
cd dist/kubeflow
npm link

# build the app frontend
cd ../../../../../jupyter/frontend
npm i
npm link kubeflow
npm run build:watch

This will result in a running front-end. Keep it open and open a new terminal to the kubeflow code to start on the backend.

Note: These instructions can be made into an executable file for speed.

sudo chmod +x filename.bin
./filename.bin

Backend

Open another cmd window

# create a virtual env and install deps
# https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
cd components/crud-web-apps/jupyter/backend
python3 -m pip install --user virtualenv
python3 -m venv web-apps-dev
source web-apps-dev/bin/activate

# install the deps on the activated virtual env
make install-deps

# run the backend
make run-dev

If it explodes, most likely due to one thing.

Try this: pip install adal
Then maybe another make run-dev
Let me know if it explodes again.
Explanation: To fix this, we need to make change kubernetes-client/python-base#84 (comment) to the kube_config.py file (found in crud-web-apps/jupyter/backend/web-apps-dev/lib/python3.7/site-packages/kubernetes/config/) - Not sure why the merged PR's fix wasn't already present in this file.

If it does, make these changes:
https://github.com/kubernetes-client/python-base/pull/141/files#diff-aff290ec1059ab1072bac2c2345dcf920b3535286175ac36d80dfcca5493be6c

After running all this, you can navigate to http://localhost:5000/ for a stable Jupyter Management UI

When I followed the README in jupyter/frontend and ran ng serve then navigated to http://localhost:4200/, I got many errors and it wouldn't let me connect to any namespace (the default was kubeflow-user). Just to get this to work, I tried to proxy to the backend like we did in our StatCan/jupyter-apis repo by adding the proxy.config.js file in crud-web-apps/jupyter/frontend and ran ng serve --proxy-config proxy.config.js. This then gave me access to the namespaces and notebook servers at http://localhost:4200/.

Still testing out this local development to see what will happen if I make changes and add in features, but that's all the progress I've made so far.

@saffaalvi
Copy link
Author

When trying to launch a new notebook server, get the following error:

[422] Notebook.kubeflow.org "test-jwa" is invalid: spec.template.spec.containers.resources.requests.cpu: Invalid value: "number": spec.template.spec.containers.resources.requests.cpu in body must be of type string: "number" http://localhost:5000/api/namespaces/saffa-alvi/notebooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant