Skip to content

Commit

Permalink
feat(monodocs): Force use x86 container
Browse files Browse the repository at this point in the history
Signed-off-by: Chi-Sheng Liu <[email protected]>
  • Loading branch information
MortalHappiness committed Apr 17, 2024
1 parent 0b8cc12 commit f14129d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ release_automation:
$(MAKE) -C docker/sandbox-bundled manifests

.PHONY: deploy_sandbox
deploy_sandbox:
deploy_sandbox:
bash script/deploy.sh

.PHONY: install-piptools
Expand Down Expand Up @@ -92,14 +92,14 @@ $(TMP_BUILD_DIR):
mkdir $@

$(TMP_BUILD_DIR)/conda-lock-image: Dockerfile.conda-lock | $(TMP_BUILD_DIR)
docker buildx build --load --build-arg USER_UID=$$(id -u) --build-arg USER_GID=$$(id -g) -t flyte-conda-lock:latest -f Dockerfile.conda-lock .
docker buildx build --load --platform=linux/amd64 --build-arg USER_UID=$$(id -u) --build-arg USER_GID=$$(id -g) -t flyte-conda-lock:latest -f Dockerfile.conda-lock .
touch $(TMP_BUILD_DIR)/conda-lock-image

monodocs-environment.lock.yaml: monodocs-environment.yaml $(TMP_BUILD_DIR)/conda-lock-image
docker run --rm --pull never -v ./:/flyte flyte-conda-lock:latest lock --file monodocs-environment.yaml --lockfile monodocs-environment.lock.yaml --channel conda-forge
docker run --platform=linux/amd64 --rm --pull never -v ./:/flyte flyte-conda-lock:latest lock --file monodocs-environment.yaml --lockfile monodocs-environment.lock.yaml

$(TMP_BUILD_DIR)/dev-docs-image: Dockerfile.docs monodocs-environment.lock.yaml | $(TMP_BUILD_DIR)
docker buildx build --load --build-arg USER_UID=$$(id -u) --build-arg USER_GID=$$(id -g) -t flyte-dev-docs:latest -f Dockerfile.docs .
docker buildx build --load --platform=linux/amd64 --build-arg USER_UID=$$(id -u) --build-arg USER_GID=$$(id -g) -t flyte-dev-docs:latest -f Dockerfile.docs .
touch $(TMP_BUILD_DIR)/dev-docs-image

# Build docs in docker container for local development
Expand Down Expand Up @@ -142,5 +142,5 @@ lint-helm-charts:
act pull_request -W .github/workflows/validate-helm-charts.yaml --container-architecture linux/amd64 -e charts/event.json

.PHONY: clean
clean: ## Remove the HTML files related to the Flyteconsole.
rm -rf cmd/single/dist
clean: ## Remove the HTML files related to the Flyteconsole and Makefile
rm -rf cmd/single/dist .tmp_build
3 changes: 0 additions & 3 deletions monodocs-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,3 @@ dependencies:

platforms:
- linux-64
- linux-aarch64
- osx-64
- osx-arm64
8 changes: 7 additions & 1 deletion script/local_build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -eo pipefail
# - DEV_DOCS_WATCH: If set, the docs will be built and served using sphinx-autobuild for live updates
# - FLYTEKIT_LOCAL_PATH: If set, the local path to flytekit will be used instead of the source code from the flyteorg/flytekit repo
# - FLYTECTL_LOCAL_PATH: If set, the local path to flytectl will be used instead of the source code from the flyteorg/flytectl repo
# - FLYTESNACKS_LOCAL_PATH: If set, the local path to flytesnacks will be used instead of the source code from the flyteorg/flytesnacks repo
#
# Example usages:
# ./script/local_build_docs.sh
Expand All @@ -32,7 +33,12 @@ if [ -n "$FLYTECTL_LOCAL_PATH" ]; then
DOCKER_ENV+=("--env" "FLYTECTL_LOCAL_PATH=/flytectl")
fi

DOCKER_CMD=("docker" "run" "--rm" "--pull" "never" "${DOCKER_ENV[@]}" "${DOCKER_PORT_MAPPING[@]}" "${DOCKER_VOLUME_MAPPING[@]}" "flyte-dev-docs:latest" "${BUILD_CMD[@]}")
if [ -n "$FLYTESNACKS_LOCAL_PATH" ]; then
DOCKER_VOLUME_MAPPING+=("-v" "$FLYTESNACKS_LOCAL_PATH:/flytesnacks")
DOCKER_ENV+=("--env" "FLYTESNACKS_LOCAL_PATH=/flytesnacks")
fi

DOCKER_CMD=("docker" "run" "--platform" "linux/amd64" "--rm" "--pull" "never" "${DOCKER_ENV[@]}" "${DOCKER_PORT_MAPPING[@]}" "${DOCKER_VOLUME_MAPPING[@]}" "flyte-dev-docs:latest" "${BUILD_CMD[@]}")

echo "${DOCKER_CMD[*]}"

Expand Down

0 comments on commit f14129d

Please sign in to comment.