Skip to content

WIP: Add kadi-apps command-line executable - #25

Open
javierggt wants to merge 4 commits into
mainfrom
kadi-apps-cmd
Open

WIP: Add kadi-apps command-line executable#25
javierggt wants to merge 4 commits into
mainfrom
kadi-apps-cmd

Conversation

@javierggt

@javierggt javierggt commented Jun 25, 2024

Copy link
Copy Markdown
Collaborator

Description

This PR adds a kadi-apps executable that internally starts a kadi-apps test server (if needed). The server stays up until the user explicitly stops it, so later calls to the command start faster. The executable then opens a browser window (after making sure the corresponding port is open).

The process management is done internally by launching a supervisord process (which the user can also kill).

I have not checked (among other things):

  • how to make sure the settings are properly passed
  • that it works for anyone other than me

Temporary changes that should be backed out before merging:

  • change in build recipe to use a branch of skare3
  • change in environment file to use the test conda channel.

Small issues

  • if one tries to start the server when it is already running, the cript writes ERROR (already started). This is not a problem. The server is not started twice.
  • it is not possible to change the ports used by supervisord and kadi-apps. We can do that if needed.
  • the script can be used to perform a few tasks, with some tasks depending on others. Each task should be idempotent. To signal failure, a task should raise an exception. Otherwise the subsequent tasks will still run. These aspects have not been thoroughly tested.

Interface impacts

Testing

Unit tests

  • No unit tests
  • Mac
  • Linux
  • Windows

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

I created a conda environment specifically for testing, both on HEAD and my machine. To create the environment:

conda create -y -n test-kadi-apps
conda activate test-kadi-apps
conda config --env --add channels conda-forge
conda config --env --add channels https://icxc.cfa.harvard.edu/aspect/ska3-conda/test
conda config --env --add channels https://icxc.cfa.harvard.edu/aspect/ska3-conda/flight
conda config --env --remove channels defaults
conda install ska3-flight ska3-perl kadi-apps==1.4.0a3

if you prefer to use the 2024.7 RC, you can do

conda create -y -n test-kadi-apps
conda activate test-kadi-apps
conda config --env --add channels conda-forge
conda config --env --add channels https://icxc.cfa.harvard.edu/aspect/ska3-conda/flight
conda config --env --add channels https://icxc.cfa.harvard.edu/aspect/ska3-conda/test
conda config --env --remove channels defaults
conda install ska3-flight ska3-perl kadi-apps

Creating the environment takes a while, as usual. After that is done:

kadi-apps

This should:

  • create a second environment (takes a while)
  • start supervisord, a daemon to manage the flask server,
  • start the server,
  • wait until the server is on,
  • open a browser window.

It is very possible that it "fails to start" only because it times out. This is faster when the environment is not new. Anyway it is never lightning fast

@javierggt
javierggt force-pushed the kadi-apps-cmd branch 2 times, most recently from 8437a14 to 799cd21 Compare July 11, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant