Closed tschaffter closed 9 months ago
@vpchung I remember we discussed the two cases: starting the challenge service with its dev server and with Docker. Do you remember if you found a solution so that the CSV files could be loaded in both cases?
The path /workspace/BOOT-INF/classes/db/platforms.csv
is only valid when starting the challenge service with its container but not with its dev server.
A solution could be to externalize the paths to the CSV files, then define different config values when running the service with its container or dev server. See
Values used in the container are:
Specifying the values in config/application-local.yml
does not work.
flyway:
placeholders:
db_platforms_csv_path: '/workspaces/sage-monorepo/apps/openchallenges/challenge-service/src/main/resources/db/platforms.csv'
db_challenges_csv_path: '/workspaces/sage-monorepo/apps/openchallenges/challenge-service/src/main/resources/db/challenges.csv'
db_contribution_roles_csv_path: '/workspaces/sage-monorepo/apps/openchallenges/challenge-service/src/main/resources/db/contribution_roles.csv'
db_incentives_csv_path: '/workspaces/sage-monorepo/apps/openchallenges/challenge-service/src/main/resources/db/incentives.csv'
db_submission_types_csv_path: '/workspaces/sage-monorepo/apps/openchallenges/challenge-service/src/main/resources/db/submission_types.csv'
The solution described in this post is to place use spring.flyway.placeholders
, which works.
Is there an existing issue for this?
What product(s) are you seeing the problem on?
OpenChallenges
Current behavior
The challenge service can load the CSV files when started with docker (
nx serve-detach
) but not when starting the dev server (nx serve
).Expected behavior
No response
Anything else?
No response
Commit ID
b98f284beafeba27548fa417e612c5d8397c0216
Are you developing inside the dev container?
Code of Conduct