-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(server): add env to define the path of build-lock.json #10810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why you can't just read this from the CWD?
Yes, we don't use relative path, only absolute paths |
server/src/constants.ts
Outdated
@@ -34,6 +34,7 @@ export const geodataDatePath = join(GEODATA_ROOT_PATH, 'geodata-date.txt'); | |||
export const geodataAdmin1Path = join(GEODATA_ROOT_PATH, 'admin1CodesASCII.txt'); | |||
export const geodataAdmin2Path = join(GEODATA_ROOT_PATH, 'admin2Codes.txt'); | |||
export const geodataCities500Path = join(GEODATA_ROOT_PATH, citiesFile); | |||
export const lockfilePath = process.env.IMMICH_BUILD_LOCK_PATH || './build-lock.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should just always use env, same as the other build-metadata stuff, with the base-image Dockerfile setting this particular one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, it would be great to group www/
, build-lock.json
and geodata/
into one folder and specify its path with an env. But I don't know if that would limit other packages like the Immich package from the AUR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of really rate having separate env for every file that we read from disk. I'd be perfectly happy with bundling all these files into a single, folder and having a single env for it. Something like IMMICH_BUILD_FILES
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be really happy too. Are you ok to have all these files/folders to /usr/src/resources
?
We would have:
/usr/src/resources/www
/usr/src/resources/geodata
/usr/src/resources/build-lock.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
@@ -51,6 +51,7 @@ Regardless of filesystem, it is not recommended to use a network share for your | |||
| `CPU_CORES` | Amount of cores available to the immich server | auto-detected cpu core count | server | | | |||
| `IMMICH_API_METRICS_PORT` | Port for the OTEL metrics | `8081` | server | api | | |||
| `IMMICH_MICROSERVICES_METRICS_PORT` | Port for the OTEL metrics | `8082` | server | microservices | | |||
| `IMMICH_BUILD_LOCK_PATH` | Path of build-lock.json | `./build-lock.json` | server | api | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we documented the other build metadata env vars right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(As in, I don't think we need to document this one either)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by 'build metadata env'? We documented IMMICH_WEB_ROOT
and IMMICH_REVERSE_GEOCODING_ROOT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to or should document build env related stuff on this page, which should just be user facing env settings.
What are you going to set it to? |
Probably |
@@ -51,6 +51,7 @@ Regardless of filesystem, it is not recommended to use a network share for your | |||
| `CPU_CORES` | Amount of cores available to the immich server | auto-detected cpu core count | server | | | |||
| `IMMICH_API_METRICS_PORT` | Port for the OTEL metrics | `8081` | server | api | | |||
| `IMMICH_MICROSERVICES_METRICS_PORT` | Port for the OTEL metrics | `8082` | server | microservices | | |||
| `IMMICH_BUILD_LOCK_PATH` | Path of build-lock.json | `./build-lock.json` | server | api | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to or should document build env related stuff on this page, which should just be user facing env settings.
server/src/constants.ts
Outdated
@@ -34,6 +34,7 @@ export const geodataDatePath = join(GEODATA_ROOT_PATH, 'geodata-date.txt'); | |||
export const geodataAdmin1Path = join(GEODATA_ROOT_PATH, 'admin1CodesASCII.txt'); | |||
export const geodataAdmin2Path = join(GEODATA_ROOT_PATH, 'admin2Codes.txt'); | |||
export const geodataCities500Path = join(GEODATA_ROOT_PATH, citiesFile); | |||
export const lockfilePath = process.env.IMMICH_BUILD_LOCK_PATH || './build-lock.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of really rate having separate env for every file that we read from disk. I'd be perfectly happy with bundling all these files into a single, folder and having a single env for it. Something like IMMICH_BUILD_FILES
or something.
2ceef13
to
8bad84a
Compare
8bad84a
to
b13ef06
Compare
Hello, have you tested this in the production build? |
Hi! I built the base-image locally and ran the production build. It's running fine. root@d98d644d1c6e:/usr/src/resources# ls -la
total 24
drwxr-xr-x 1 root root 4096 Jul 3 20:19 .
drwxr-xr-x 1 root root 4096 Jul 3 20:11 ..
-rw-r--r-- 1 root root 694 Jun 30 13:08 build-lock.json
drwxr-xr-x 2 root root 4096 Jul 3 20:13 geodata
drwxr-xr-x 3 root root 4096 Jul 3 20:19 www |
b13ef06
to
c0309cd
Compare
Closing in favor of #10958. |
This PR adds an env to define the path of
build-lock.json