-
Notifications
You must be signed in to change notification settings - Fork 16
Developing for ML Hub on Tapis UI
Dhanny Indrakusuma edited this page Jul 30, 2024
·
8 revisions
The notes below are also available on my Notion notes
- Docker version 24.0.5 or above | installation
- Install NVM
- Ensure you are using the appropriate version of Node + NPM, use
nvm
to manage dependencies as below:nvm install v22.2.0
nvm use v22.2.0
- As ML Hub API is deployed on
NGINX
it will now automatically proxy authentication based on tenant.
- On your local copy of the
tapis-ui
repository, pull the latest version ofdev
branch by running the commandgit pull origin dev
- Create a new git branch based on your task following naming convention of
task/TUI-<issue#>--<description>
for example:git checkout -b task/TUI-373--mlhub-inference-info
- If this is the first time you are running the project on the new
task
branch, follow the steps in sequence:-
Create a
.env
file at the roottapis-ui
folder, defining environment variables as below:VITE_SERVERLESS_DEPLOYMENT = "false" VITE_TAPIS_BASE_URL = "https://dev.develop.tapis.io"
-
Run the command
npm run init-project
from the roottapis-ui
folder -
TapisUI will open on http://localhost:3000/#/
-
- If you had previously ran the project in your machine (for your current
task
branch) by following the steps in #3- Use the command
npm run dev
- If you did not encounter any errors so far, TapisUI will open on http://localhost:3000/#/
- Use the command
Follow these steps if you encountered errors
- To prevent errors delete
node_modules
anddist
folders as well aspackage-lock.json
file in each subfolders in thelib
folder - In the root
tapis-ui
folder, delete thenode_modules
folder andpackage-lock.json
file - Check the
/tmp
folder in your machine (usecd /tmp
command to navigate) - if there is atapisui-extensions-core
folder there, use the commandrm -rf tapisui-extensions-core
to delete it - Run the command
npm run init-project
from the roottapis-ui
folder
Another way to run the app if you encountered error using previous method
- On your terminal, run the command
cd packages/tapisui-hooks
to navigate topackages
>tapis-hooks
- From within the
tapis-hooks
directory, run the commandnpm install
, followed by the commandnpm run build
to rebuildtapis-hooks
- On your terminal, run the command
cd ../../
to navigate back to thetapis-ui
root directory - In the root directory of
tapis-ui
runnpm install
followed bynpm run start
- Change the version number of the npm packages in the
package.json
inside:-
tapis-ui
root directory -
packages
>tapisui-api
-
packages
>tapisui-hooks
-
packages
>tapisui-common
-
- Follow the same steps as outlined in "Developing & running Tapis UI locally"
WARNING - Do this after you are done developing your feature for your current task
branch and about to submit a PR Request:
- Prior to submitting Pull Request run the linter on the root directory of
tapis-ui
: runnpm run prettier
followed by annpm run lint
- This step ensures that the Github tests on the PR will run smoothly
If the PR is approved & merged to dev
branch, you can check https://tacc.develop.tapis.io/tapis-ui/#/ml-hub to see if the feature is working as expected