-
Notifications
You must be signed in to change notification settings - Fork 60
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1fb6992
Add Faros CE Docker Desktop Extension
bidzhao 9d531e0
Merge pull request #1 from bidzhao/docker-extension
bidzhao cc7130f
Add missed .env file for React
bidzhao 1a7b8cf
Merge pull request #2 from bidzhao/docker-extension
bidzhao d5174e6
Clone the existing root .env file into the folder for consistency
bidzhao 87b7ba9
Merge pull request #3 from bidzhao/docker-extension
bidzhao dd31dc8
Removes the need for env files
thomas-gerber f28614e
Multi-arch build
thomas-gerber 3448517
Better image name
thomas-gerber 4debc4d
Proper multi-arch build
thomas-gerber 6870b80
Updated documentation
thomas-gerber d58a510
Uses Faros logo
thomas-gerber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
# This file needs to be both in the root of the repository | ||
# and in kube/base/faros/config | ||
# until there is support for removing load restrictions in remote directories | ||
# see: https://github.com/kubernetes-sigs/kustomize/issues/4052 | ||
# and: https://github.com/faros-ai/faros-community-edition/issues/193 | ||
COMPOSE_PROFILES="airbyte,default,faros-db" | ||
|
||
############################## Faros ########################################## | ||
# The db_host, db_port, db_user and db_pass are identical to those used by Airbyte. | ||
# This is because we use a single db service for the Faros Community Edition deployment and host all required databases | ||
# on the same host. That service is faros-db, which extends the airbyte db service. | ||
# These can be overriden as needed. | ||
# Note that hosts (faros host, faros config host, airbyte host) MUST correspond a service running postgres. | ||
FAROS_CONFIG_DB_HOST=faros-db | ||
FAROS_CONFIG_DB_PORT=5432 | ||
FAROS_CONFIG_DB_USER=docker | ||
FAROS_CONFIG_DB_PASSWORD=docker | ||
FAROS_DB_NAME=faros | ||
FAROS_DB_HOST=faros-db | ||
FAROS_DB_PORT=5432 | ||
FAROS_DB_USER=docker | ||
FAROS_DB_PASSWORD=docker | ||
FAROS_INIT_LOG_LEVEL=info | ||
FAROS_AIRBYTE_FORCE_SETUP=false | ||
FAROS_INIT_IMAGE=farosai/faros-ce-init:latest | ||
|
||
############################## Airbyte ######################################## | ||
VERSION=0.39.37-alpha | ||
# Airbyte Internal Job Database, see https://docs.airbyte.io/operator-guides/configuring-airbyte-db | ||
DATABASE_USER=docker | ||
DATABASE_PASSWORD=docker | ||
DATABASE_HOST=faros-db | ||
DATABASE_PORT=5432 | ||
DATABASE_DB=airbyte | ||
# translate manually DATABASE_URL=jdbc:postgresql://${DATABASE_HOST}:${DATABASE_PORT/${DATABASE_DB} (do not include the username or password here) | ||
DATABASE_URL=jdbc:postgresql://faros-db:5432/airbyte | ||
# Host must correspond to the service name running webapp | ||
AIRBYTE_URL=http://airbyte-webapp:80 | ||
AIRBYTE_DESTINATION_HASURA_URL=http://localhost:8080 | ||
|
||
############################## Hasura ######################################### | ||
HASURA_DB_NAME=hasura | ||
HASURA_PORT=8080 | ||
HASURA_GRAPHQL_ADMIN_SECRET=admin | ||
HASURA_URL=http://hasura:8080 | ||
HASURA_VERSION=v2.1.1 | ||
|
||
############################## Metabase ####################################### | ||
METABASE_IMAGE="metabase/metabase" | ||
METABASE_VERSION=v0.45.2.1 | ||
METABASE_DB_NAME=metabase | ||
METABASE_PORT=3000 | ||
METABASE_USER=admin@admin.com | ||
METABASE_PASSWORD=admin | ||
METABASE_URL=http://metabase:3000 | ||
METABASE_USE_SSL=false | ||
# The db_host used in Metabase to connect to the Faros database. | ||
METABASE_FAROS_DB_HOST=faros-db | ||
|
||
############################## n8n ############################################ | ||
N8N_DB_NAME=n8n | ||
N8N_PORT=5678 | ||
N8N_VERSION=0.164.1 | ||
N8N_DOCKER_MOUNT=n8n_data | ||
|
||
############################## AirByte default config ######################### | ||
# This file only contains Docker relevant variables. | ||
# | ||
# Variables with defaults have been omitted to avoid duplication of defaults. | ||
# The only exception to the non-default rule are env vars related to scaling. | ||
# | ||
# See https://github.com/airbytehq/airbyte/blob/master/airbyte-config/models/src/main/java/io/airbyte/config/Configs.java | ||
# for the latest environment variables. | ||
# | ||
# # Contributors - please organise this env file according to the above linked file. | ||
|
||
# Source: https://github.com/airbytehq/airbyte/blob/v0.39.37-alpha/.env | ||
|
||
### SHARED ### | ||
|
||
# When using the airbyte-db via default docker image | ||
CONFIG_ROOT=/data | ||
DATA_DOCKER_MOUNT=airbyte_data | ||
DB_DOCKER_MOUNT=airbyte_db | ||
|
||
# Workspace storage for running jobs (logs, etc) | ||
WORKSPACE_ROOT=/tmp/workspace | ||
WORKSPACE_DOCKER_MOUNT=airbyte_workspace | ||
|
||
# Local mount to access local files from filesystem | ||
# todo (cgardens) - when we are mount raw directories instead of named volumes, *_DOCKER_MOUNT must | ||
# be the same as *_ROOT. | ||
# Issue: https://github.com/airbytehq/airbyte/issues/578 | ||
LOCAL_ROOT=/tmp/airbyte_local | ||
LOCAL_DOCKER_MOUNT=/tmp/airbyte_local | ||
# todo (cgardens) - hack to handle behavior change in docker compose. *_PARENT directories MUST | ||
# already exist on the host filesystem and MUST be parents of *_ROOT. | ||
# Issue: https://github.com/airbytehq/airbyte/issues/577 | ||
HACK_LOCAL_ROOT_PARENT=/tmp | ||
|
||
|
||
### DATABASE ### | ||
JOBS_DATABASE_MINIMUM_FLYWAY_MIGRATION_VERSION=0.29.15.001 | ||
|
||
# Airbyte Internal Config Database, defaults to Job Database if empty. Explicitly left empty to mute docker compose warnings. | ||
CONFIG_DATABASE_USER= | ||
CONFIG_DATABASE_PASSWORD= | ||
CONFIG_DATABASE_URL= | ||
CONFIGS_DATABASE_MINIMUM_FLYWAY_MIGRATION_VERSION=0.35.15.001 | ||
|
||
### AIRBYTE SERVICES ### | ||
TEMPORAL_HOST=airbyte-temporal:7233 | ||
INTERNAL_API_HOST=airbyte-server:8001 | ||
WEBAPP_URL=http://localhost:8000/ | ||
# Although not present as an env var, required for webapp configuration. | ||
API_URL=/api/v1/ | ||
|
||
|
||
### JOBS ### | ||
# Relevant to scaling. | ||
SYNC_JOB_MAX_ATTEMPTS=1 | ||
SYNC_JOB_MAX_TIMEOUT_DAYS=1 | ||
JOB_MAIN_CONTAINER_CPU_REQUEST= | ||
JOB_MAIN_CONTAINER_CPU_LIMIT= | ||
JOB_MAIN_CONTAINER_MEMORY_REQUEST= | ||
JOB_MAIN_CONTAINER_MEMORY_LIMIT= | ||
|
||
|
||
### LOGGING/MONITORING/TRACKING ### | ||
TRACKING_STRATEGY=logging | ||
JOB_ERROR_REPORTING_STRATEGY=logging | ||
# Although not present as an env var, expected by Log4J configuration. | ||
LOG_LEVEL=INFO | ||
|
||
|
||
### APPLICATIONS ### | ||
# Worker # | ||
# Relevant to scaling. | ||
MAX_SYNC_WORKERS=5 | ||
MAX_SPEC_WORKERS=5 | ||
MAX_CHECK_WORKERS=5 | ||
MAX_DISCOVER_WORKERS=5 | ||
# Temporal Activity configuration | ||
ACTIVITY_MAX_ATTEMPT= | ||
ACTIVITY_INITIAL_DELAY_BETWEEN_ATTEMPTS_SECONDS= | ||
ACTIVITY_MAX_DELAY_BETWEEN_ATTEMPTS_SECONDS= | ||
WORKFLOW_FAILURE_RESTART_DELAY_SECONDS= | ||
|
||
|
||
### FEATURE FLAGS ### | ||
AUTO_DISABLE_FAILING_CONNECTIONS=false | ||
EXPOSE_SECRETS_IN_EXPORT=false | ||
FORCE_MIGRATE_SECRET_STORE=false | ||
|
||
### MONITORING FLAGS ### | ||
# Accepted values are datadog and otel (open telemetry) | ||
METRIC_CLIENT= | ||
# Useful only when metric client is set to be otel. Must start with http:// or https://. | ||
OTEL_COLLECTOR_ENDPOINT="http://host.docker.internal:4317" | ||
|
||
USE_STREAM_CAPABLE_STATE=false | ||
|
||
# extra settings to limit warnings during CE startup | ||
PAPERCUPS_STORYTIME=disabled | ||
RUN_DATABASE_MIGRATION_ON_STARTUP=true | ||
SECRET_PERSISTENCE=NONE | ||
WORKER_ENVIRONMENT=docker | ||
NEW_SCHEDULER= | ||
DEPLOYMENT_MODE= | ||
JOB_ERROR_REPORTING_SENTRY_DSN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM --platform=$BUILDPLATFORM node:17.7-alpine3.14 AS client-builder | ||
ARG TARGETARCH | ||
WORKDIR /ui | ||
# cache packages in layer | ||
COPY ui/package.json /ui/package.json | ||
COPY ui/package-lock.json /ui/package-lock.json | ||
RUN --mount=type=cache,target=/usr/src/app/.npm \ | ||
npm set cache /usr/src/app/.npm && \ | ||
npm ci | ||
# install | ||
COPY ui /ui | ||
RUN npm run build | ||
COPY docker-compose_${TARGETARCH}.yaml /compose/docker-compose.yaml | ||
|
||
FROM alpine | ||
LABEL org.opencontainers.image.title="Faros" \ | ||
org.opencontainers.image.description="Faros extension for Docker Desktop" \ | ||
org.opencontainers.image.vendor="Faros AI, Inc." \ | ||
com.docker.desktop.extension.api.version="0.3.3" \ | ||
com.docker.extension.screenshots="[{\"alt\":\"Faros Architecture\",\"url\":\"https://raw.githubusercontent.com/faros-ai/faros-community-edition/main/img/architecture.png\"}]" \ | ||
com.docker.extension.detailed-description="" \ | ||
com.docker.extension.publisher-url="https://github.com/faros-ai/faros-community-edition" \ | ||
com.docker.extension.additional-urls="" \ | ||
com.docker.extension.changelog="" \ | ||
com.docker.desktop.extension.icon="https://raw.githubusercontent.com/faros-ai/faros-community-edition/main/img/faros.ico" \ | ||
com.docker.extension.categories="utility-tools" | ||
|
||
COPY --from=client-builder /compose/docker-compose.yaml . | ||
COPY metadata.json . | ||
COPY faros.svg . | ||
COPY --from=client-builder /ui/dist ui | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
IMAGE?=farosai/faros-ce-docker-extension | ||
TAG?=latest | ||
|
||
BUILDER=buildx-multi-arch | ||
|
||
INFO_COLOR = \033[0;36m | ||
NO_COLOR = \033[m | ||
|
||
build-extension: ## Build service image to be deployed as a desktop extension | ||
docker build --tag=$(IMAGE):$(TAG) . | ||
|
||
install-extension: build-extension ## Install the extension | ||
docker extension install $(IMAGE):$(TAG) | ||
|
||
update-extension: build-extension ## Update the extension | ||
docker extension update $(IMAGE):$(TAG) | ||
|
||
prepare-buildx: ## Create buildx builder for multi-arch build, if not exists | ||
docker buildx inspect $(BUILDER) || docker buildx create --name=$(BUILDER) --driver=docker-container --driver-opt=network=host | ||
|
||
push-extension: prepare-buildx ## Build & Upload extension image to hub. Do not push if tag already exists: make push-extension tag=0.1 | ||
docker pull $(IMAGE):$(TAG) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=$(TAG) --tag=$(IMAGE):$(TAG) . | ||
|
||
help: ## Show this help | ||
@echo Please specify a build target. The choices are: | ||
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(INFO_COLOR)%-30s$(NO_COLOR) %s\n", $$1, $$2}' | ||
|
||
.PHONY: help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Faros CE Docker Desktop Extension | ||
|
||
See Docker extension SDK, especially the UI and VM sections of the metadata. | ||
* The difference between the docker-compose files is the metabase image used. | ||
* The docker-compose files are copies of the original one with all parameters set. It is not possible to easily pass environment variables to the extension. | ||
|
||
## Installation | ||
|
||
1. Build Docker image | ||
|
||
```shell | ||
docker build --tag=farosai/faros-ce-docker-extension:latest . | ||
``` | ||
|
||
2. Install extension | ||
|
||
```shell | ||
docker extension install farosai/faros-ce-docker-extension:latest | ||
``` | ||
|
||
## Clean up | ||
|
||
```shell | ||
docker extension rm farosai/faros-ce-docker-extension:latest | ||
``` | ||
|
||
## Further reading | ||
Docker extension SDK, especially the UI and VM sections of the metadata | ||
We use different docker-compose files |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 .
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 randocker 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.
@bidzhao
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