FIREFLY-1648: fix Dockerfile parsing envVars bugs#1698
Conversation
|
I want to look at this in detail but right away I think it is important to test Jenkin with a the first as I don't see spaces in you string test also |
robyww
left a comment
There was a problem hiding this comment.
It looks good and appears to work. I think the python makes it easier to work with and to read.
I really like the parameter passing being so clean now.
If you want to keep launchTomcat.sh (it might a good idea for a cycle or two) around for awhile you should put some deprecation message at the top.
I do think if we are going to do this in python we should follow PEP 8. That is what we are doing with firefly_client. IntelliJ sets that up by default I think. I least mine does.
There are several sections that needs to be cleaned up to be PEP 8 like.
I personally am not a big fan of PEP 8 but I think we should be consistent.
docker/entrypoint.py
Outdated
| print("========== Information: you can set environment variable using -e on docker run line ===== \n") | ||
| print("Environment Variables:") | ||
| print(" Description Name Value") | ||
| print(" ----------- -------- -----") |
There was a problem hiding this comment.
You would do this whole thing with:
print(f"""
...many lines of stuff...
""")
docker/entrypoint.py
Outdated
| os.environ["JPDA_ADDRESS"] = "*:5050" | ||
| CATALINA_HOME = os.getenv("CATALINA_HOME", "/usr/local/tomcat") | ||
| VISUALIZE_FITS_SEARCH_PATH = os.getenv("VISUALIZE_FITS_SEARCH_PATH", "") | ||
| START_MODE = os.getenv("START_MODE", "run") | ||
| NAME = os.getenv("BUILD_TIME_NAME", "ipac/firefly") | ||
| ADMIN_USER = os.getenv("ADMIN_USER", "admin") | ||
| ADMIN_PASSWORD = os.getenv("ADMIN_PASSWORD", base64.b64encode(str(random.randint(100000, 999999)).encode()).decode()[:8]) |
There was a problem hiding this comment.
this is not very standard python style.
instead
catalina_home = os.getenv("CATALINA_HOME", "/usr/local/tomcat")and other similar lines
|
|
||
| return props_opts | ||
|
|
||
| def add_single_prop_env_vars(): |
There was a problem hiding this comment.
PEP3 is picky... it wants to lines before a function
Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1648
This PR addresses several issues and improvements related to environment variable parsing.
The key changes are:
Test via Jenkins + Helm: https://firefly-1648-envvars-parsing.irsakudev.ipac.caltech.edu/irsaviewer/
This is built with FIREFLY_PROPS=
I'm not entirely sure what all of this means, but I can confirm that it's hitting irsadev instead of irsa and that HiPS coverage is using SDSS9 color.
Test via Docker Compose:
Added to firefly-docker.env
Start Firefly using Docker Comopse
cd firefly docker compose up firefly --buildVerify that Firefly is now running at http://localhost:8080/local/firefly/ instead of /firefly/
Go to /admin/status -> click 'Debug Info'
to see that PROPS (multi-props) and PROPS_OP_tap_additional.. (single prop) are set.
You can also run
docker compose run firefly --dry-runto see what envVars were used and how it will appears in theCATALINA_OPTSenvVar.If you have python3 installed, you can run unit tests:
cd firefly/docker python3 entrypoint_test.pyThese are fixes to Jenkins script if interested. commit and commit