Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC87: updated application.properties example and documentation so works in default docker config #10944

Closed

Conversation

pappde
Copy link
Contributor

@pappde pappde commented Aug 15, 2024

Updated the application.properties example and download_custom_buttons_json documentation to a configuration that will work in the default docker config. Specifically, changed from using "classpath:" to

download_custom_buttons_json=/cbioportal-webapp/custom_buttons/download_custom_button_avm.json

Explanation

It seems that the "classpath:" syntax doesn't work with the readFile() method used by FrontendProperties. This commit changes the example to use the absolute path that matches how the default docker config is set (files installed to /cbioportal-webapp/).

Further Improvements

Ideally, either a relative path or "classpath:" would work for the application.properties. Then all configurations would work with a copy/paste of the reference.

Checks

Tested on local docker running 6.016.

Notify reviewers

@alisman

@pappde pappde marked this pull request as draft August 16, 2024 16:31
@pappde
Copy link
Contributor Author

pappde commented Aug 16, 2024

Putting this back in draft mode, since the instructions may not work as is for private instances.

ISSUE

Turns out that, at least for the public instance, the docker container uses the "/docker/web/Dockerfile" configuration which deploys everything as an app.jar. So readFile() will fail, since it looks for loose files on the filesystem.

Note: Local development instructions use the "/docker/web-and-data/Dockerfile" configuration which deploys the directory structure as loose files, which is why it works in testing.

OPTIONS

Most likely, either of the following will solve it:

A) readFile() needs to be updated to be able to load using "classpath;" syntax, which appears to be the intent of the documentation/examples. See getResourceStream() for an example of using the ClassLoader, which should work for the app.jar. Then the original syntax should work:

download_custom_buttons_json=classpath:/custom_buttons/download_custom_button_avm.json

B) config files like this need to be deployed to be loose on the server (outside the app.jar). For example, modifying /docker/web/Dockerfile like this:

COPY --from=build ${DEPENDENCY}/BOOT-INF/classes/custom_buttons             $PORTAL_WEB_HOME/custom_buttons  

then this syntax works

download_custom_buttons_json=/cbioportal-webapp/custom_buttons/download_custom_button_avm.json

@pappde pappde closed this Aug 16, 2024
@pappde
Copy link
Contributor Author

pappde commented Aug 16, 2024

closing - going to replace with new PR that fixes the issue

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