Skip to content

Commit

Permalink
[#61664] codespace: Dockerfile-lxqt: Update base image
Browse files Browse the repository at this point in the history
Updates the base image for the `lxqt` to use latest ORFS from docker
registries.

Replaces manual docker build invocation with appropriate action in the
workflow.

Signed-off-by: Illia Vysochyn <ivysochyn@antmicro.com>
  • Loading branch information
ivysochyn committed Jul 10, 2024
1 parent 03dbe33 commit 55b498d
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/ubuntu-gui-full/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

{
"image": "ghcr.io/antmicro/openroad-flow-scripts:lxqt",
"image": "ghcr.io/the-openroad-project/openroad-flow-scripts:lxqt",
"forwardPorts": [6080],
"portsAttributes": {
"6080": {
Expand Down
82 changes: 35 additions & 47 deletions .github/workflows/github-actions-publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- flow/Makefile
- docker/Dockerfile.dev
- docker/Dockerfile.builder
- tools/codespace/scripts/**
- tools/codespace/Dockerfile-lxqt
pull_request:
paths:
- etc/DependencyInstaller.sh
Expand All @@ -20,6 +22,8 @@ on:
- flow/Makefile
- docker/Dockerfile.dev
- docker/Dockerfile.builder
- tools/codespace/scripts/**
- tools/codespace/Dockerfile-lxqt

jobs:
buildCodespaceImage:
Expand All @@ -28,29 +32,29 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set environment variables
run: echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry (GHCR)
if: github.event_name != 'pull_request' && github.repository == 'antmicro/openroad-flow-scripts'
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: gha
password: ${{ github.token }}

- name: Build ORFS
run: |
docker build -t ghcr.io/antmicro/openroad-flow-scripts:orfs -f tools/codespace/Dockerfile-orfs .
- name: Push container image to GitHub Container Registry (GHCR)
if: github.event_name != 'pull_request' && github.repository == 'antmicro/openroad-flow-scripts'
run: docker push ghcr.io/antmicro/openroad-flow-scripts:orfs

- name: Build LXQt
run: |
docker build -t ghcr.io/antmicro/openroad-flow-scripts:lxqt -f tools/codespace/Dockerfile-lxqt .
- name: Push container image to GitHub Container Registry (GHCR)
if: github.event_name != 'pull_request' && github.repository == 'antmicro/openroad-flow-scripts'
run: docker push ghcr.io/antmicro/openroad-flow-scripts:lxqt
- name: Build and export codespaces image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.IMAGE }}:lxqt
file: tools/codespace/Dockerfile-lxqt
cache-from: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache

buildDependenciesImage:
strategy:
Expand All @@ -60,7 +64,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
Expand Down Expand Up @@ -92,7 +96,6 @@ jobs:
file: docker/Dockerfile.dev
build-args: |
fromImage=${{ matrix.os[1] }}
numThreads=$(nproc)
cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache,mode=max

Expand All @@ -110,7 +113,7 @@ jobs:
tool-cache: false

- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
Expand All @@ -119,27 +122,11 @@ jobs:
run: |
echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')/${{ matrix.os }}" >> $GITHUB_ENV
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os }}" >> $GITHUB_ENV
echo "NUM_THREADS=$(nproc)" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# We don't use the build-push-action here because it hangs
- name: Build ORFS image
run: |
docker buildx build \
--load \
--build-arg fromImage=${{ env.IMAGE_DEPS }}:latest \
--build-arg numThreads=$(nproc) \
--cache-from type=registry,ref=${{ env.IMAGE }}:buildcache \
--tag ${{ env.IMAGE }}:latest \
--file docker/Dockerfile.builder \
.
- name: Test build
run: |
cmd="source ./env.sh && yosys -help && openroad -help && make -C flow ;"
docker run ${{ env.IMAGE }}:latest /bin/bash -c "${cmd}"
- name: Login to GitHub Container Registry (GHCR)
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
Expand All @@ -148,14 +135,15 @@ jobs:
username: gha
password: ${{ github.token }}

- name: Export ORFS image
run: |
docker buildx build \
--build-arg fromImage=${{ env.IMAGE_DEPS }}:latest \
--build-arg numThreads=$(nproc) \
--cache-from type=registry,ref=${{ env.IMAGE }}:buildcache \
--cache-to type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max \
--tag ${{ env.IMAGE }}:latest \
--file docker/Dockerfile.builder \
--push \
.
- name: Build and export ORFS image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.IMAGE }}:latest
file: docker/Dockerfile.builder
build-args: |
fromImage=${{ env.IMAGE_DEPS }}
numThreads=${{ env.NUM_THREADS }}
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
2 changes: 1 addition & 1 deletion tools/codespace/Dockerfile-lxqt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2024 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0

FROM ghcr.io/antmicro/openroad-flow-scripts:orfs
FROM openroad/orfs:latest

COPY ./tools/codespace/scripts/common.sh /usr/local/bin/common.sh
COPY ./tools/codespace/scripts/install-desktop-deps.sh /usr/local/bin/install-desktop-deps.sh
Expand Down
13 changes: 0 additions & 13 deletions tools/codespace/Dockerfile-orfs

This file was deleted.

6 changes: 3 additions & 3 deletions tools/codespace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ First time Codespace users are encouraged to read the tutorial [creating a codes

### OpenROAD GUI

At the bottom, there should be tab `PORTS`, where you will find the `Forwarded Address`. A link labelled `Desktop (6080) is provided, which you can follow to open the OpenROAD GUI.
At the bottom, there should be tab `PORTS`, where you will find the `Forwarded Address`. A link labelled `Desktop (6080)` is provided, which you can follow to open the OpenROAD GUI.

![open](../../docs/images/open_vnc.gif)

Test that the ORFS flow works by running the following commands:

```
cd ~/OpenROAD-flow-scripts/flow
. ../env.sh
cd /OpenROAD-flow-scripts/flow
source ../env.sh
make
make gui_final
```
Expand Down
39 changes: 0 additions & 39 deletions tools/codespace/scripts/install-orfs.sh

This file was deleted.

0 comments on commit 55b498d

Please sign in to comment.