Skip to content

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

Dependencies

  • 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:
    1. nvm install v22.2.0
    2. nvm use v22.2.0
  • As ML Hub API is deployed on NGINX it will now automatically proxy authentication based on tenant.

Developing & running Tapis UI locally

  1. On your local copy of the tapis-ui repository, pull the latest version of dev branch by running the command git pull origin dev
  2. 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
  3. 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 root tapis-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 root tapis-ui folder

    • TapisUI will open on http://localhost:3000/#/

  4. If you had previously ran the project in your machine (for your current task branch) by following the steps in #3
Follow these steps if you encountered errors
  1. To prevent errors delete node_modules and dist folders as well as package-lock.json file in each subfolders in the lib folder
  2. In the root tapis-ui folder, delete the node_modules folder and package-lock.json file
  3. Check the /tmp folder in your machine (use cd /tmp command to navigate) - if there is a tapisui-extensions-core folder there, use the command rm -rf tapisui-extensions-core to delete it
  4. Run the command npm run init-project from the root tapis-ui folder
Another way to run the app if you encountered error using previous method
  1. On your terminal, run the command cd packages/tapisui-hooks to navigate to packages > tapis-hooks
  2. From within the tapis-hooks directory, run the command npm install , followed by the command npm run build to rebuild tapis-hooks
  3. On your terminal, run the command cd ../../ to navigate back to the tapis-ui root directory
  4. In the root directory of tapis-ui run npm install followed by npm run start

Upgrading @tapis/tapis-typescript and @tapis/tapis-typescript-mlhub-models to the latest versions

  • 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: run npm run prettier followed by an npm 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