These scripts are meant to be run from an Open Data Hub JupyterHub environment and provide some basic scripted functions for creating a new project, repo, and application.
Install scripts and pre-requisites.
curl -o- https://raw.githubusercontent.com/rh-aiservices-pilot/odh-s2i-scripts/master/install.sh | bash
Initializes a file structure including notebooks and a buildable s2i flask application.
odh new-project
Initializes and creates a new repository in GitHub.
odh new-repo <repo_directory>
Creates a new OpenShift application (deployment, service, buildconfig, imagestream, route) for model serving from the GitHub repo in a directory (<repo-directory>
) in an OpenShift project (<oc-project>
).
You must be logged into the OpenShift cluster using oc login
using either username and password or a token. Full documentation here
oc login --token=sha256~XYZ --server=https://api.my-cluster:6443
odh new-app <repo-directory> <oc-project>
Optionally, after creating the application, view the build config and add a webhook in GitHub. The application will rebuild on git push
- In the project repo click Settings -> Webhooks
- Click Add webhook
- Paste the value from BuildConfig
- Change Content type to JSON
- Click Add Webhook to save