-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Faros CE Docker Desktop Extension #287
Conversation
Add Faros CE Docker Desktop Extension
CLA Assistant Lite bot: Thank you for your submission, we really appreciate it. Faros can accept contrbutions only from authors who accepted and signed Contributor License Agreement. Please kindly read it and accept by posting the following comment on this PR: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
@bidzhao thank you for the contribution! What exactly does this functionality provide? Why are there so many files copied over? This could become a problem to maintain. |
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.
See build error
COPY docker-compose.yaml . | ||
COPY metadata.json . | ||
COPY docker.svg . | ||
COPY --from=client-builder /ui/dist ui |
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.
@bidzhao this errors out when I run docker build --tag=faros/extension:latest .
=> ERROR [stage-1 5/5] COPY --from=client-builder /ui/dist ui 0.0s
------
> [stage-1 5/5] COPY --from=client-builder /ui/dist ui:
------
failed to compute cache key: "/ui/dist" not found: not found
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.
Could you execute "docker system prune -y" and try again?
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.
there was no -y
option, so I ran
docker system prune -a
and
docker system prune --volumes
Afterwards, same issue.
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.
Sorry, I mean "docker image prune -a -f" and "docker system prune -a -f". I couldn't reproduce it locally. Could you please share your full build logs and your local env information, e.g. OS, docker version...? Here is my docker version:
$ docker version
Client:
Cloud integration: v1.0.31
Version: 20.10.23
API version: 1.41
Go version: go1.18.10
Git commit: 7155243
Built: Thu Jan 19 17:35:19 2023
OS/Arch: darwin/amd64
Context: default
Experimental: true
Server: Docker Desktop 4.17.0 (99724)
Engine:
Version: 20.10.23
API version: 1.41 (minimum version 1.12)
Go version: go1.18.10
Git commit: 6051f14
Built: Thu Jan 19 17:32:04 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.18
GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
And here is my build log:
$ docker build --tag=faros/extension:latest .
[+] Building 100.3s (18/18) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 84B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 1.3s
=> [internal] load metadata for docker.io/library/node:17.7-alpine3.14 0.0s
=> [stage-1 1/5] FROM docker.io/library/alpine@sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 1.50MB 0.1s
=> [client-builder 1/7] FROM docker.io/library/node:17.7-alpine3.14 0.1s
=> [client-builder 2/7] WORKDIR /ui 0.1s
=> CACHED [stage-1 2/5] COPY docker-compose.yaml . 0.0s
=> CACHED [stage-1 3/5] COPY metadata.json . 0.0s
=> [stage-1 4/5] COPY docker.svg . 0.1s
=> [client-builder 3/7] COPY ui/package.json /ui/package.json 0.0s
=> [client-builder 4/7] COPY ui/package-lock.json /ui/package-lock.json 0.0s
=> [client-builder 5/7] RUN --mount=type=cache,target=/usr/src/app/.npm npm set cache /usr/src/app/.npm && npm ci 55.9s
=> [client-builder 6/7] COPY ui /ui 0.1s
=> [client-builder 7/7] RUN npm run build 41.0s
=> [stage-1 5/5] COPY --from=client-builder /ui/dist ui 0.1s
=> exporting to image 0.1s
=> => exporting layers 0.0s
=> => writing image sha256:15f5df9e1334307de443edb42a0024048596ceb7737b172c88c072d073deaea8 0.0s
=> => naming to docker.io/faros/extension:latest
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.
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.02kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 3.1s
=> [internal] load metadata for docker.io/library/node:17.7-alpine3.14 3.1s
=> [client-builder 1/7] FROM docker.io/library/node:17.7-alpine3.14@sha2 3.0s
=> => resolve docker.io/library/node:17.7-alpine3.14@sha256:539e64749f7d 0.0s
=> => sha256:539e64749f7dc6c578d744d879fd0ec37f3afe552ae 1.43kB / 1.43kB 0.0s
=> => sha256:ce3358b66925f144108f66802a25e737a5ac991bf77 1.16kB / 1.16kB 0.0s
=> => sha256:ed51fad11ee87160e0d69d19e6a6be7420b4965a516 6.59kB / 6.59kB 0.0s
=> => sha256:93a1719cf26168d3a85db2594d76b17ccc4b2599662 2.72MB / 2.72MB 0.3s
=> => sha256:d2265413694a4d0534e08f3e9e2905b3f1aaa2764 45.80MB / 45.80MB 2.0s
=> => extracting sha256:93a1719cf26168d3a85db2594d76b17ccc4b25996620bcee 0.1s
=> => sha256:fde43f4aec85f9b625dfdc638777e23463ce71d6485 2.41MB / 2.41MB 0.8s
=> => sha256:d2b665bc6eb16560a5048ef9659e50d863af154e2c4cb0b 450B / 450B 0.8s
=> => extracting sha256:d2265413694a4d0534e08f3e9e2905b3f1aaa2764a1a5c75 0.7s
=> => extracting sha256:fde43f4aec85f9b625dfdc638777e23463ce71d648577b2d 0.1s
=> => extracting sha256:d2b665bc6eb16560a5048ef9659e50d863af154e2c4cb0bc 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 1.48MB 0.1s
=> [stage-1 1/5] FROM docker.io/library/alpine@sha256:69665d02cb32192e52 0.5s
=> => resolve docker.io/library/alpine@sha256:69665d02cb32192e52e07644d7 0.0s
=> => sha256:c41ab5c992deb4fe7e5da09f67a8804a46bd0592bfdf0b1 528B / 528B 0.0s
=> => sha256:d74e625d91152966d38fe8a62c60daadb96d4b94c1a 1.49kB / 1.49kB 0.0s
=> => sha256:af6eaf76a39c2d3e7e0b8a0420486e3df33c4027d69 3.26MB / 3.26MB 0.3s
=> => sha256:69665d02cb32192e52e07644d76bc6f25abeb5410ed 1.64kB / 1.64kB 0.0s
=> => extracting sha256:af6eaf76a39c2d3e7e0b8a0420486e3df33c4027d696c076 0.1s
=> [stage-1 2/5] COPY docker-compose.yaml . 0.1s
=> [stage-1 3/5] COPY metadata.json . 0.0s
=> [stage-1 4/5] COPY docker.svg . 0.0s
=> [client-builder 2/7] WORKDIR /ui 0.2s
=> [client-builder 3/7] COPY ui/package.json /ui/package.json 0.0s
=> [client-builder 4/7] COPY ui/package-lock.json /ui/package-lock.json 0.0s
=> [client-builder 5/7] RUN --mount=type=cache,target=/usr/src/app/.npm 27.3s
=> [client-builder 6/7] COPY ui /ui 0.0s
=> [client-builder 7/7] RUN npm run build 18.8s
=> ERROR [stage-1 5/5] COPY --from=client-builder /ui/dist ui 0.0s
------
> [stage-1 5/5] COPY --from=client-builder /ui/dist ui:
------
failed to compute cache key: "/ui/dist" not found: not found
thomasgerber@Thomass-MacBook-Pro-2 docker-extension % docker version
Client:
Cloud integration: v1.0.29
Version: 20.10.22
API version: 1.41
Go version: go1.18.9
Git commit: 3a2c30b
Built: Thu Dec 15 22:28:41 2022
OS/Arch: darwin/arm64
Context: default
Experimental: true
Server: Docker Desktop 4.16.2 (95914)
Engine:
Version: 20.10.22
API version: 1.41 (minimum version 1.12)
Go version: go1.18.9
Git commit: 42c8b31
Built: Thu Dec 15 22:25:43 2022
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.6.14
GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
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.
Sorry, it is my fault that .env file was missed for React. I have added it with commit of cc7130f
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.
ok it works now
docker-extension/env
Outdated
FAROS_START_SOURCE= | ||
HASURA_URL=http://hasura:8080 | ||
LOG_LEVEL=info | ||
METABASE_FAROS_DB_HOST=faros-db |
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.
@bidzhao no METABASE_PORT?
could you explain how you built this env file from the main 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.
In general, I extraced the env values from .env file with the environment variables defined by all containers in docker-comose.yaml. I didn't find anywhere METABASE_PORT is used in docker-compose.yaml, so I think we may don't need it. Please correct me if my understanding is wrong.
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.
@bidzhao https://github.com/faros-ai/faros-community-edition/blob/main/.env#L52 / https://github.com/faros-ai/faros-community-edition/blob/main/docker-compose.yaml#L246
Should we just clone the existing root .env file into the folder for consistency?
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.
Yes, we could if you don't mind duplicate .env file under sub-directory.
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 do not mind, we already have something similar here: https://github.com/faros-ai/faros-community-edition/blob/main/kube/base/faros/config/.env
We check it is the same in our git workflows, will add this one as well.
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.
Added.
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.
so now, what is the difference between the docker-extension/env
and the docker-extension/.env
files?
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.
Some keys are different. For example, There are sth. like LOG_LEVEL: ${FAROS_INIT_LOG_LEVEL:-info}
and POSTGRES_PWD=${DATABASE_PASSWORD}
defined in the root docker-compose.yaml, They are FAROS_INIT_LOG_LEVEL=info
and DATABASE_PASSWORD=docker
in docker-extension/.env file. So they are not suitable to be re-used in env_file. That is why I have to change them to LOG_LEVEL=info
and POSTGRES_PWD=docker
in docker-extension/env file.
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.
Solved by passing all environment variables explicitly in the docker-compose files.
I have read the CLA Document and I hereby sign the CLA. |
Add missed .env file for React
Clone the existing root .env file into the folder for consistency
@bidzhao 2 questions:
|
|
For the image, I meant the container image; |
Maybe the simplest given the trouble with env files is to put all the variables directly in the docker-compose file with the environment attribute. For the local volumes, we can transform them into persistent volumes. I tested, it works (at least those that started with FAROS_CONF_DIR). |
Maybe the simplest given the trouble with env files is to put all the variables directly in the docker-compose file with the environment attribute. For the local volumes, we can transform them into persistent volumes. I tested, it works (at least those that started with FAROS_CONF_DIR). |
This PR removes the need to put hardcoded links to env files and volumes in the docker-compose file.
To support metabase arm64 image being used.
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.
Issues addressed
Description
Add Faros CE Docker Desktop Extension
Type of change
Checklist
(Delete what does not apply)