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

Build: Print version (hash) tag whenever app starts #57

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

Cahb
Copy link
Contributor

@Cahb Cahb commented Jul 1, 2024

Sample output:

docker logs openlan_cgw 
[2024-07-01T09:55:30Z INFO  ucentral_cgw] Starting CGW application, rev tag: 5149edb
[2024-07-01T09:55:30Z INFO  ucentral_cgw] (1048576, 1048576)
[2024-07-01T09:55:30Z INFO  ucentral_cgw] (1048576, 1048576)

...

docker logs openlan_cgw 
[2024-07-01T09:58:01Z INFO  ucentral_cgw] Starting CGW application, rev tag: 5149edb-dirty
[2024-07-01T09:58:01Z INFO  ucentral_cgw] (1048576, 1048576)
[2024-07-01T09:58:01Z INFO  ucentral_cgw] (1048576, 1048576)

@Cahb Cahb force-pushed the feat/print_app_ver_on_start branch 3 times, most recently from 3beb101 to 5ef742e Compare July 1, 2024 10:44
@Cahb
Copy link
Contributor Author

Cahb commented Jul 1, 2024

Don't mind the pushes;
Just poking around the github actions to find the right flow;

@Cahb Cahb force-pushed the feat/print_app_ver_on_start branch 7 times, most recently from 6a94ccf to 9a9d91f Compare July 1, 2024 12:03
@Cahb Cahb requested a review from carsten989 July 1, 2024 12:03
@Cahb
Copy link
Contributor Author

Cahb commented Jul 1, 2024

@carsten989 i've added you to the reviewer list to only address the issue i'm having with CI integration: it seems like i cannot simply pass for docker action, as this action is included furthermore the action hierarchy;

Please note, that this PR currently doesn't work OK with CI, so it's not to be merged yet;

NOTE: sample of warning that pops-up

Warning: Unexpected input(s) 'build-args', valid inputs are ['image_name', 'registry', 'registry_user', 'registry_password', 'checkout_fetch_depth']

@carsten989
Copy link
Collaborator

So it looks like setting CGW_WSS_THREAD_NUM is no longer supported?
I would have taken care of the CI part of this at least on that side, but thanks!
Please also take a look at https://reproducible-builds.org/docs/source-date-epoch/
See the Dockerfile part. Just adding ARG SOURCE_DATE_EPOCH high up in the target copying portion, should allow you to reference that env var.

@Cahb
Copy link
Contributor Author

Cahb commented Jul 1, 2024

@carsten989

So it looks like setting CGW_WSS_THREAD_NUM is no longer supported?

The confusion basically comes from the following:
Code uses the DEFAULT_WSS_THREAD_NUM:

191         let wss_t_num: usize = match env::var("DEFAULT_WSS_THREAD_NUM") {        

The script we used to run deployment manually through the make run actually pointed to enviroment variable:

-       -e CGW_WSS_THREAD_NUM      \

So i changed it to export right env:

+       -e DEFAULT_WSS_THREAD_NUM  \

(Because application expects exact name);

The pod config should be the same, i've just check it's the <DEFAULT_WSS_THREAD_NUM=8> env var that gets exported;

Or are you using the helper script as well, sorry? Did i brake your deployment?

@Cahb
Copy link
Contributor Author

Cahb commented Jul 1, 2024

I would have taken care of the CI part of this at least on that side, but thanks!
Please also take a look at https://reproducible-builds.org/docs/source-date-epoch/
See the Dockerfile part. Just adding ARG SOURCE_DATE_EPOCH high up in the target copying portion, should allow you to reference that env var.

So, the problem is the changes in this pr still do not work and i think the doc you're referencing is purely for TS, righ?
Because i'd love to see the hash inside the CGW app;

@Cahb
Copy link
Contributor Author

Cahb commented Jul 1, 2024

@carsten989 maybe we can jump into slack to discuss / find a potential fix or way-to-go for this issue (the docker build-args one)?

Cahb added 3 commits July 1, 2024 21:00
NOTE: CI changes will be made in other PRs.
This one only covers the buildsystem / application part;

Signed-off-by: Oleksandr Mazur <[email protected]>
Originally <as> is lowercased in present Dockerfile, which might
omit warnings upon build.
Fix this by uppercasing the <AS> instructions.

Signed-off-by: Oleksandr Mazur <[email protected]>
@Cahb Cahb force-pushed the feat/print_app_ver_on_start branch from 9a9d91f to 969ef8b Compare July 1, 2024 18:11
@Cahb Cahb merged commit 6ac82b0 into next Jul 1, 2024
2 checks passed
@Cahb Cahb deleted the feat/print_app_ver_on_start branch July 1, 2024 18:17
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.

2 participants