Slimmed the image
All checks were successful
Publish FaceAI Container / publish (push) Successful in 2m54s
All checks were successful
Publish FaceAI Container / publish (push) Successful in 2m54s
This commit is contained in:
parent
8ac86ffe36
commit
cf316c8563
8 changed files with 34 additions and 22 deletions
|
|
@ -79,7 +79,7 @@ The local stack also mounts:
|
|||
- `./logs` into both the public FaceAI container and the processor container as the persistent diagnostics directory
|
||||
- `../www` into the PHP container so the real bridge files are used
|
||||
|
||||
The `processor` service is built from `docker/processor.Dockerfile` using the repository root as Docker build context. That image copies the checked-in `bin/Face_Recognition_Unix` directory into `/opt/face-recognition` during `docker build`, so the matcher binary is baked into the image instead of being mounted from the host at runtime.
|
||||
The `processor` service is built from `docker/processor.Dockerfile` using the repository root as Docker build context. That image copies only the checked-in Unix `face_matcher` into the image, so the matcher is baked into the processor runtime without bringing along the other Unix or Windows binaries.
|
||||
|
||||
### Persistent Logs
|
||||
|
||||
|
|
@ -219,9 +219,9 @@ When enabled, the live suite also:
|
|||
|
||||
If the processor logs show an error like `spawn /opt/face-recognition/face_matcher ENOENT`, the problem is not the upload flow itself. It means the running processor cannot see the matcher binary at the configured `FACEAI_MATCHER_BINARY` path.
|
||||
|
||||
With the current checked-in Dockerfiles, the matcher binary is copied into the image from the repository source tree during `docker build`. The runtime container no longer needs a host bind mount for `/opt/face-recognition`.
|
||||
With the current checked-in Dockerfiles, only the Unix `face_matcher` is copied into the processor image from the repository source tree during `docker build`. The runtime container no longer needs a host bind mount for `/opt/face-recognition`.
|
||||
|
||||
Published images now get that binary because the Forgejo container workflow builds from the repository root, which lets `faceai/docker/Dockerfile` copy:
|
||||
Published images now get that binary because the Forgejo container workflow builds a dedicated processor image from the repository root, which lets `faceai/docker/processor.Dockerfile` copy:
|
||||
|
||||
```text
|
||||
bin/Face_Recognition_Unix/face_matcher
|
||||
|
|
@ -309,7 +309,7 @@ services:
|
|||
condition: service_healthy
|
||||
|
||||
processor:
|
||||
image: forgejo.maddoscientisto.net/maddo/faceai-client:latest
|
||||
image: forgejo.maddoscientisto.net/maddo/faceai-processor:latest
|
||||
container_name: regalami-faceai-processor
|
||||
restart: unless-stopped
|
||||
command:
|
||||
|
|
@ -384,7 +384,7 @@ Processor settings:
|
|||
| Variable | Required | Example | Purpose |
|
||||
| --- | --- | --- | --- |
|
||||
| `FACEAI_PKL_ROOT` | yes | `/data/pkl` | mounted race-to-PKL dataset root |
|
||||
| `FACEAI_MATCHER_BINARY` | yes | `/opt/face-recognition/face_matcher` | matcher executable baked into the image |
|
||||
| `FACEAI_MATCHER_BINARY` | yes | `/opt/face-recognition/face_matcher` | matcher executable baked into the processor image |
|
||||
| `FACEAI_WORKER_CONCURRENCY` | optional | `2` | BullMQ worker concurrency |
|
||||
| `FACEAI_WORKER_TIMEOUT_MS` | optional | `300000` | matcher timeout in milliseconds |
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export async function runFaceMatcher({ matcherBinary, selfiePath, pklPath, csvPa
|
|||
child.on('error', (error) => {
|
||||
clearTimeout(timer);
|
||||
if (error?.code === 'ENOENT') {
|
||||
reject(new Error(`face_matcher not found at ${matcherBinary}. Check FACEAI_MATCHER_BINARY and the processor bind mount.`));
|
||||
reject(new Error(`face_matcher not found at ${matcherBinary}. Check FACEAI_MATCHER_BINARY or the bundled Unix matcher binary in the processor image.`));
|
||||
return;
|
||||
}
|
||||
reject(error);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ async function ensureMatcherBinaryAvailable() {
|
|||
await fs.access(config.matcherBinary, fsConstants.X_OK);
|
||||
} catch (error) {
|
||||
console.error(`FaceAI processor cannot start because the matcher binary is unavailable: ${config.matcherBinary}`);
|
||||
console.error('Ensure FACEAI_MATCHER_BINARY points to a real executable and that the processor bind mount contains face_matcher.');
|
||||
console.error('Ensure FACEAI_MATCHER_BINARY points to a real executable and that the processor image includes the Unix face_matcher binary.');
|
||||
if (error?.code === 'ENOENT') {
|
||||
console.error('The configured matcher path does not exist inside the processor runtime.');
|
||||
} else if (error?.code === 'EACCES') {
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ COPY faceai/apps/processor/package.json apps/processor/package.json
|
|||
RUN npm install
|
||||
|
||||
COPY faceai/ .
|
||||
COPY bin/Face_Recognition_Unix /opt/face-recognition
|
||||
|
||||
RUN chmod +x /opt/face-recognition/face_matcher
|
||||
|
||||
RUN npm run build
|
||||
|
||||
|
|
@ -31,10 +28,8 @@ RUN apt-get update \
|
|||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app /app
|
||||
COPY --from=build /opt/face-recognition /opt/face-recognition
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV FACEAI_MATCHER_BINARY=/opt/face-recognition/face_matcher
|
||||
EXPOSE 3001
|
||||
|
||||
CMD ["npm", "run", "start"]
|
||||
|
|
@ -8,7 +8,7 @@ RUN apt-get update \
|
|||
WORKDIR /app
|
||||
|
||||
COPY faceai /app
|
||||
COPY bin/Face_Recognition_Unix /opt/face-recognition
|
||||
COPY bin/Face_Recognition_Unix/face_matcher /opt/face-recognition/face_matcher
|
||||
|
||||
RUN chmod +x /opt/face-recognition/face_matcher
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue