This post will go over the steps for setting up the local development for nova, which is a frontend interface platform at ORNL that interacts with the backend Galaxy workflow platform.

  • First, set up the conda environment,

      [CONDA_SUBDIR=osx-64] conda create -n pdiffvis -c conda-forge -c mantid python=3.10 mantid poetry
      conda activate pdiffvis
    

    [CONDA_SUBDIR=osx-64] (without the bracket) is only necessary for Mac machines with ARM architecture.

  • Then run poetry install

  • Next we want to mock the directory structure on ORNL Analysis cluster. On Linux, we can use sudo privilege to create /SNS and /HFIR directories and all the sub-directories. On MacOS, one cannot create directories under / even with sudo privilege so one has to use the following trick,

    • Populate the file /etc/synthetic.conf with
      SNS	Users/y8z/SNS
    

    where y8z is my user name.

    Attention: the white space in there is necessarily a Tab.

    • Run the following command,
      /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t
    

    Then we need to create a directory SNS under our home directory. The command above would create a soft link from /SNS to /Users/y8z/SNS. Then we can populate with files under /Users/y8z/SNS following the same structure as on Analysis.

  • Next, run the following command to configure pre-commit so that any time codes are committed, some actions such as format checking will be triggered automatically before pushing the codes to the repo.

      poetry run pre-commit install
    
  • Then it should be ready so we can run,

      poetry run app
    

    to start the app, which will automatically launch the browser to see the app.

  • Once we are happy with the local changes with the codes, we can push the codes to the repo so that it can be deployed into the nova test environment. Then the app can be accessed from nova-test.ornl.gov. To deploy, we need,

    • Edit pyproject.toml to update the version

    • Commit and push the local changes

    • Run poetry run deploy-tool

      docker has to be installed for this command to work.