Skip to content

Commit

Permalink
Remove OPENLANE_IMAGE_NAME from docker build and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Apr 8, 2024
1 parent 21605ad commit e4c82b6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
4 changes: 0 additions & 4 deletions .github/actions/set_env_variables/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ runs:
- name: Export Branch Name
shell: bash
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Export Temp Image Name
shell: bash
run: echo "OPENLANE_IMAGE_NAME=openlane:intermediate" >> $GITHUB_ENV
5 changes: 0 additions & 5 deletions .github/scripts/gh.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ def export_env_alt(key, value):
print('Environment variables required: "PDK_ROOT"')
exit(os.EX_CONFIG)

if os.getenv("OPENLANE_IMAGE_NAME") is None:
print('Environment variables required: "OPENLANE_IMAGE_NAME"')
exit(os.EX_CONFIG)

origin = os.getenv("REPO_URL")
repo = Repo("Openlane", origin)

Expand All @@ -136,7 +132,6 @@ def export_env_alt(key, value):
"run_id": os.getenv("GITHUB_RUN_ID"),
"origin": origin,
"branch": os.getenv("BRANCH_NAME"),
"image": os.getenv("OPENLANE_IMAGE_NAME"),
"root": os.getenv("GITHUB_WORKSPACE"),
"pdk_root": os.getenv("PDK_ROOT"),
"pdk": os.getenv("PDK"),
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
f"PDK_ROOT={gh.pdk_root}",
"-e",
f"PDK={gh.pdk}",
gh.image,
f"efabless/openlane2:current-amd64",
"bash",
"-c",
shlex.join(
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openlane_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ jobs:

- name: Run Test
run: |
OPENLANE_IMAGE_NAME=$OPENLANE_IMAGE_NAME-amd64\
OPENLANE_IMAGE_NAME=efabless/openlane:current-amd64\
python3 ${GITHUB_WORKSPACE}/.github/scripts/run_tests.py ${{ matrix.design.name }}
- name: Escape Design Name
Expand Down Expand Up @@ -355,7 +355,7 @@ jobs:
run: |
for tag in $TAG_LIST; do
for arch in amd64 arm64v8; do
docker image tag ${{ env.OPENLANE_IMAGE_NAME }}-$arch ${{ vars.DOCKER_IMAGE }}:$tag-$arch
docker image tag efabless/openlane:current-$arch ${{ vars.DOCKER_IMAGE }}:$tag-$arch
docker push ${{ vars.DOCKER_IMAGE }}:$tag-$arch
done
docker manifest create ${{ vars.DOCKER_IMAGE }}:$tag\
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ ENV_COMMAND = $(ENV_START) $(OPENLANE_IMAGE_NAME)-$(DOCKER_ARCH)
all: get-openlane pdk

.PHONY: openlane
openlane: venv/created
@PYTHON_BIN=$(PWD)/venv/bin/$(PYTHON_BIN) $(MAKE) -C docker openlane
openlane:
@$(MAKE) -C docker openlane
docker tag efabless/openlane:current-$(DOCKER_ARCH) $(OPENLANE_IMAGE_NAME)-$(DOCKER_ARCH)

.PHONY: openlane-and-push-tools
openlane-and-push-tools: venv/created
Expand Down
1 change: 1 addition & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tar/
/openlane/
ol2_hash
/openlane2
/result
6 changes: 2 additions & 4 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
PYTHON_BIN ?= python3
OPENLANE_IMAGE_NAME ?= efabless/openlane:current
BUILD_ARCH ?= $(shell $(PYTHON_BIN) ./current_platform.py)
NIX_SYSTEM ?= $(shell $(PYTHON_BIN) ./current_system.py $(BUILD_ARCH))
NIX_SYSTEM := $(shell $(PYTHON_BIN) ./current_system.py $(BUILD_ARCH))

HASH = $(shell git rev-parse HEAD)
HASH_SHORT = $(shell git rev-parse --short=7 HEAD)
Expand All @@ -21,5 +20,4 @@ merge: openlane
.PHONY: openlane
openlane:
$(BUILD_CMD)
cat $$($(BUILD_CMD)) | docker load
docker tag openlane:tmp-$(NIX_SYSTEM) $(OPENLANE_IMAGE_NAME)-$(BUILD_ARCH)
cat ./result | docker load
15 changes: 12 additions & 3 deletions docker/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,22 @@
neovim,
zsh,
silver-searcher,
}: let
}:

assert builtins.elem system ["x86_64-linux" "aarch64-linux"];

let
openlane-env-sitepackages = "${openlane1.pyenv}/${openlane1.pyenv.sitePackages}";
openlane-env-bin = "${openlane1.pyenv}/bin";
docker-arch-name = if system == "x86_64-linux" then
"amd64"
else
"arm64v8"
;
in
dockerTools.buildImage rec {
name = "openlane";
tag = "tmp-${system}";
name = "efabless/openlane";
tag = "current-${docker-arch-name}";

copyToRoot = buildEnv {
name = "image-root";
Expand Down

0 comments on commit e4c82b6

Please sign in to comment.