Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker test #9

Open
wants to merge 199 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
779e645
Create dependabot.yml
jordancarlin Jul 3, 2024
d648474
Update dependabot.yml
jordancarlin Jul 3, 2024
5a1a0ef
Update dependabot.yml
jordancarlin Jul 3, 2024
0378212
Update dependabot.yml
jordancarlin Jul 3, 2024
9dd279a
Test installation regression GitHub action
jordancarlin Jul 5, 2024
80d262a
Update install.yml
jordancarlin Jul 5, 2024
2ad2485
Update install.yml
jordancarlin Jul 5, 2024
f48c1d9
Update install.yml
jordancarlin Jul 5, 2024
74e6cfc
Update install.yml
jordancarlin Jul 5, 2024
0bf21a8
Update install.yml
jordancarlin Jul 5, 2024
40901b9
Update install.yml
jordancarlin Jul 6, 2024
8e4217b
Update install.yml
jordancarlin Jul 6, 2024
35b8891
Update install.yml
jordancarlin Jul 6, 2024
eefc88a
Create rocky.yml
jordancarlin Jul 6, 2024
5884d07
Update rocky.yml
jordancarlin Jul 6, 2024
8e65c7d
Update rocky.yml
jordancarlin Jul 7, 2024
8eaacc9
Update rocky.yml
jordancarlin Jul 7, 2024
74d2672
Update rocky.yml
jordancarlin Jul 7, 2024
8b70fb4
Update rocky.yml
jordancarlin Jul 7, 2024
2893b90
Update rocky.yml
jordancarlin Jul 7, 2024
c7e98b3
Update rocky.yml
jordancarlin Jul 7, 2024
c03377e
Update rocky.yml
jordancarlin Jul 7, 2024
07caabd
Update rocky.yml
jordancarlin Jul 7, 2024
6b63eab
Update rocky.yml
jordancarlin Jul 7, 2024
f1fa537
More rocky testing
jordancarlin Jul 16, 2024
dbdef47
New rocky approach
jordancarlin Jul 16, 2024
9349ade
Update rocky.yml for Rocky 8 testing
jordancarlin Jul 16, 2024
3e32ab1
Update rocky.yml for Rocky 8 testing
jordancarlin Jul 16, 2024
2daf69f
Save space on rocky
jordancarlin Jul 16, 2024
b3057c7
Test all supported distros
jordancarlin Jul 16, 2024
d98209b
Add quotes
jordancarlin Jul 16, 2024
7e07421
fewer targets
jordancarlin Jul 16, 2024
55cb8b0
Continue install tests if one fails
jordancarlin Jul 16, 2024
844b687
test
jordancarlin Jul 16, 2024
45d7696
Update test
jordancarlin Jul 16, 2024
3304998
update test
jordancarlin Jul 16, 2024
d86e103
Run make and regression-wally in installation test
jordancarlin Jul 16, 2024
93e38dd
Checkout submodules in install test action
jordancarlin Jul 16, 2024
9269b09
add test
jordancarlin Jul 16, 2024
4134daa
install git in redhat docker test
jordancarlin Jul 16, 2024
ca7ad33
update test
jordancarlin Jul 16, 2024
265934c
Update test.yml
jordancarlin Jul 17, 2024
7cd2db6
Update test.yml
jordancarlin Jul 17, 2024
fad82ec
Create cli-space-cleanup.sh
jordancarlin Jul 17, 2024
608d7a5
Update test.yml
jordancarlin Jul 17, 2024
68d6e8d
make cli-space-cleanup executable
jordancarlin Jul 17, 2024
4e8b2d1
Update test.yml
jordancarlin Jul 17, 2024
b940ac7
Update cli-space-cleanup.sh
jordancarlin Jul 17, 2024
5c6abe4
Update test.yml
jordancarlin Jul 17, 2024
f3f29a8
Updates
jordancarlin Jul 17, 2024
d356356
Update test.yml
jordancarlin Jul 17, 2024
b6cf953
New install action
jordancarlin Jul 17, 2024
d12b00b
Fix installation workflow curl-minimal dependency
jordancarlin Jul 17, 2024
dbd849b
Updates
jordancarlin Jul 17, 2024
a072dff
Update test.yml
jordancarlin Jul 17, 2024
d7af21a
Updates
jordancarlin Jul 18, 2024
5db2669
Update shell
jordancarlin Jul 18, 2024
5956e70
Remove test.yml
jordancarlin Jul 19, 2024
1c869af
Update Makefile
jordancarlin Jul 19, 2024
a2dd070
reduce riscof jobs
jordancarlin Jul 19, 2024
0d1ab18
try 2 riscof jobs
jordancarlin Jul 20, 2024
b100850
Add clean + update checks
jordancarlin Jul 20, 2024
8632e97
updates
jordancarlin Jul 20, 2024
df6e970
try 3 riscof jobs
jordancarlin Jul 20, 2024
9a94f87
no buildroot
jordancarlin Jul 20, 2024
6a4d42f
Remove riscof debug
jordancarlin Jul 20, 2024
d1f3b00
Make all git directories safe in installation action
jordancarlin Jul 20, 2024
a382e0c
Manually run wsim
jordancarlin Jul 20, 2024
a60907f
Only build riscof tests in installation ci
jordancarlin Jul 20, 2024
73e94c7
Update install.yml
jordancarlin Jul 21, 2024
88f2adc
Update wsim to return exit value
jordancarlin Jul 21, 2024
c0dab87
Use regression-wally in install cli
jordancarlin Jul 21, 2024
d1b4b21
Increase stack and upload logs
jordancarlin Jul 21, 2024
1276b64
Update artifact upload
jordancarlin Jul 21, 2024
bbfe8d9
Save installation logs
jordancarlin Jul 23, 2024
1d45d46
Add python requirements.text
jordancarlin Jul 3, 2024
1818d7e
Initial docker image autobuild
jordancarlin Jul 21, 2024
abef308
Fix rocky prereqs
jordancarlin Jul 21, 2024
d945f02
Build Ubuntu docker image
jordancarlin Jul 21, 2024
131f0ef
Ubuntu20 docker image
jordancarlin Jul 22, 2024
f4e9e71
Ubuntu20 docker image with tests compiled
jordancarlin Jul 22, 2024
14f4cb6
Add display statements
jordancarlin Jul 22, 2024
71c5a7a
Update dockerBuild.yml
jordancarlin Jul 22, 2024
f6acbf1
Update Dockerfile
jordancarlin Jul 22, 2024
dc26431
Update ubuntu dockerfile
jordancarlin Jul 22, 2024
1a2b0e2
Update ubuntu
jordancarlin Jul 22, 2024
2221724
Update shell
jordancarlin Jul 22, 2024
f0dbe69
Add tests back to ubuntu image
jordancarlin Jul 22, 2024
b7e9815
Test installation regression GitHub action
jordancarlin Jul 5, 2024
9997102
Update install.yml
jordancarlin Jul 5, 2024
a77d916
Update install.yml
jordancarlin Jul 5, 2024
7c9fd34
Update install.yml
jordancarlin Jul 5, 2024
e67e250
Update install.yml
jordancarlin Jul 5, 2024
14b189b
Update install.yml
jordancarlin Jul 5, 2024
611f5e9
Update install.yml
jordancarlin Jul 6, 2024
0873633
Update install.yml
jordancarlin Jul 6, 2024
ccd4dd0
Update install.yml
jordancarlin Jul 6, 2024
0c0689d
Create rocky.yml
jordancarlin Jul 6, 2024
6b6e060
Update rocky.yml
jordancarlin Jul 6, 2024
41223af
Update rocky.yml
jordancarlin Jul 7, 2024
e3dfa08
Update rocky.yml
jordancarlin Jul 7, 2024
37fccc9
Update rocky.yml
jordancarlin Jul 7, 2024
75eeb28
Update rocky.yml
jordancarlin Jul 7, 2024
d0ce864
Update rocky.yml
jordancarlin Jul 7, 2024
059507f
Update rocky.yml
jordancarlin Jul 7, 2024
20a7164
Update rocky.yml
jordancarlin Jul 7, 2024
b245295
Update rocky.yml
jordancarlin Jul 7, 2024
ff1e35b
Update rocky.yml
jordancarlin Jul 7, 2024
4628fc6
More rocky testing
jordancarlin Jul 16, 2024
3d421c0
New rocky approach
jordancarlin Jul 16, 2024
e37d9dc
Update rocky.yml for Rocky 8 testing
jordancarlin Jul 16, 2024
429f1d2
Update rocky.yml for Rocky 8 testing
jordancarlin Jul 16, 2024
45f3e0f
Save space on rocky
jordancarlin Jul 16, 2024
aecc371
Test all supported distros
jordancarlin Jul 16, 2024
da729a9
Add quotes
jordancarlin Jul 16, 2024
634eff1
fewer targets
jordancarlin Jul 16, 2024
7b07527
Continue install tests if one fails
jordancarlin Jul 16, 2024
450e767
Add test.yml
jordancarlin Jul 16, 2024
9728f71
Update test
jordancarlin Jul 16, 2024
46b4891
update test
jordancarlin Jul 16, 2024
8d4dabe
Run make and regression-wally in installation test
jordancarlin Jul 16, 2024
8b488ea
Checkout submodules in install test action
jordancarlin Jul 16, 2024
a34c77d
add test
jordancarlin Jul 16, 2024
3e853ae
install git in redhat docker test
jordancarlin Jul 16, 2024
0df5e99
update test
jordancarlin Jul 16, 2024
77bed91
Update test.yml
jordancarlin Jul 17, 2024
6f94e8c
Update test.yml
jordancarlin Jul 17, 2024
936f54d
Create cli-space-cleanup.sh
jordancarlin Jul 17, 2024
747648b
Update test.yml
jordancarlin Jul 17, 2024
166b09e
make cli-space-cleanup executable
jordancarlin Jul 17, 2024
746f86d
Update test.yml
jordancarlin Jul 17, 2024
3632c47
Update cli-space-cleanup.sh
jordancarlin Jul 17, 2024
c79fc1e
Update test.yml
jordancarlin Jul 17, 2024
b508009
Update install test with space saver
jordancarlin Jul 17, 2024
934d19a
Update test.yml
jordancarlin Jul 17, 2024
eb2193c
New install action
jordancarlin Jul 17, 2024
96f2748
Fix installation workflow curl-minimal dependency
jordancarlin Jul 17, 2024
50c7683
Update cli-space-saver
jordancarlin Jul 17, 2024
22fbd81
Update test.yml
jordancarlin Jul 17, 2024
ec62a1e
Update shell
jordancarlin Jul 18, 2024
5bbaf73
Remove test.yml
jordancarlin Jul 19, 2024
e0f3a4c
Update Makefile
jordancarlin Jul 19, 2024
9a0b1bf
reduce riscof jobs
jordancarlin Jul 19, 2024
239d356
try 2 riscof jobs
jordancarlin Jul 20, 2024
5b6a073
Add clean + update checks
jordancarlin Jul 20, 2024
9d79f37
updates
jordancarlin Jul 20, 2024
fdcaa81
try 3 riscof jobs
jordancarlin Jul 20, 2024
ed22f2f
no buildroot
jordancarlin Jul 20, 2024
b9d82b7
Remove riscof debug
jordancarlin Jul 20, 2024
eca8273
Make all git directories safe in installation action
jordancarlin Jul 20, 2024
551c157
Manually run wsim
jordancarlin Jul 20, 2024
a7d3367
Only build riscof tests in installation ci
jordancarlin Jul 20, 2024
8857793
Update install.yml
jordancarlin Jul 21, 2024
cd6a0c7
Use regression-wally in install cli
jordancarlin Jul 21, 2024
570f7a8
Upload logs
jordancarlin Jul 21, 2024
583ea91
Update artifact upload
jordancarlin Jul 21, 2024
de77c39
Save installation logs
jordancarlin Jul 23, 2024
4e8425c
Add buildroot to installation test
jordancarlin Jul 23, 2024
69710a3
Rhel buildroot
jordancarlin Jul 23, 2024
0d39dcc
Run make linux with sudo in installation test
jordancarlin Jul 24, 2024
91030c7
Log buildroot test
jordancarlin Jul 24, 2024
014b125
Change number of riscof jobs in installation test action; restore def…
jordancarlin Jul 25, 2024
a52fd30
Update install test to preserve variables for buildroot build
jordancarlin Jul 26, 2024
a380ffa
Update install test with buildroot changes
jordancarlin Jul 26, 2024
626fd4a
Switch test install to use buildroot from install script
jordancarlin Jul 26, 2024
2c275e1
Switch rhel installation test to use install script buildroot
jordancarlin Jul 26, 2024
b1f97df
Turn off debugging messages
jordancarlin Jul 27, 2024
a717c57
Update installation test logging
jordancarlin Aug 8, 2024
633249c
Add non-sudo and custom location installation tests
jordancarlin Aug 8, 2024
d9d0a60
Update gcc activation method for old distros
jordancarlin Aug 9, 2024
24925e4
Merge branch 'main' of https://github.com/openhwgroup/cvw
jordancarlin Aug 11, 2024
dfdb529
Merge remote-tracking branch 'upstream/main'
jordancarlin Aug 17, 2024
9fb027e
Switch to new RISCOF humber of jobs in install test
jordancarlin Aug 17, 2024
d8dadcc
Merge branch 'main' of https://github.com/openhwgroup/cvw
jordancarlin Aug 29, 2024
3775266
Use sail binary release
jordancarlin Aug 29, 2024
3d44297
No more opam
jordancarlin Aug 29, 2024
0f07a96
Remove sail dependencies from package install
jordancarlin Aug 29, 2024
a73772e
Don't install z3 for sail
jordancarlin Aug 29, 2024
38d920f
Use cp -r for sail
jordancarlin Aug 29, 2024
5dc9976
Simplify install using curl for extra dependencies
jordancarlin Aug 29, 2024
e0b486b
Fix sail binary install
jordancarlin Aug 29, 2024
2501129
Remove remaining mentions of opam
jordancarlin Aug 29, 2024
fe4ae36
Installation fixes
jordancarlin Aug 29, 2024
894174c
Update Sail status messages
jordancarlin Aug 29, 2024
20e1fac
Installation tar fixes
jordancarlin Aug 29, 2024
eda3a81
Debugging statements
jordancarlin Aug 29, 2024
b3c842a
Use temp sail model version
jordancarlin Aug 30, 2024
9eafde7
Don’t install newer glib and skip qemu
jordancarlin Sep 8, 2024
4319d2d
Skip buildroot installation for Verilator test
jordancarlin Sep 8, 2024
cf03316
Merge branch 'main' of https://github.com/openhwgroup/cvw
jordancarlin Sep 8, 2024
dfeaf7f
Fix tar
jordancarlin Sep 8, 2024
6d6c5a9
Restore QEMU and Buildroot to installation flow
jordancarlin Sep 11, 2024
1d5493f
Merge branch 'main' into docker
jordancarlin Sep 11, 2024
efe24e1
Cleanup
jordancarlin Sep 11, 2024
c3c53cf
Docker updates
jordancarlin Sep 11, 2024
b08ccbb
Update docker image name
jordancarlin Sep 11, 2024
60ce4ef
Dockerfile updates
jordancarlin Sep 11, 2024
b7a2b6e
Add license header to Dockerfile
jordancarlin Sep 11, 2024
cae0fc6
Fix docker build github action
jordancarlin Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/cli-space-cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
###########################################
## GitHub runner space cleanup
##
## Written: Jordan Carlin, [email protected]
## Created: 30 June 2024
## Modified:
##
## Purpose: Remove unnecessary packages/directories from GitHub Actions runner

## A component of the CORE-V-WALLY configurable RISC-V project.
## https://github.com/openhwgroup/cvw
##
## Copyright (C) 2021-23 Harvey Mudd College & Oklahoma State University
##
## SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
##
## Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file
## except in compliance with the License, or, at your option, the Apache License version 2.0. You
## may obtain a copy of the License at
##
## https:##solderpad.org/licenses/SHL-2.1/
##
## Unless required by applicable law or agreed to in writing, any work distributed under the
## License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
## either express or implied. See the License for the specific language governing permissions
## and limitations under the License.
################################################################################################

# Remove unnecessary packages
removePacks=( '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' '^dotnet-sdk-.*' 'azure-cli' 'google-cloud-cli' 'google-chrome-stable' 'firefox' '^powershell*' 'microsoft-edge-stable' 'mono-devel' 'hhvm' )
for pack in "${removePacks[@]}"; do
sudo apt-get purge -y "$pack" || true
done
sudo apt-get autoremove -y || true
sudo apt-get clean || true

# Remove unnecessary directories
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/share/miniconda
sudo rm -rf /usr/share/az*
sudo rm -rf /usr/share/gradle-*
sudo rm -rf /usr/share/sbt
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/julia*
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/share/vcpkg
sudo rm -rf /usr/local/games
sudo rm -rf /usr/local/sqlpackage
sudo rm -rf /usr/lib/google-cloud-sdk
sudo rm -rf /usr/lib/jvm
sudo rm -rf /usr/lib/mono
sudo rm -rf /usr/lib/R
sudo rm -rf /usr/lib/postgresql
sudo rm -rf /usr/lib/heroku
sudo rm -rf /usr/lib/firefox
sudo rm -rf /opt/hostedtoolcache

# Clean up docker images
sudo docker image prune --all --force
32 changes: 32 additions & 0 deletions .github/workflows/dockerBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Docker Image
on: [workflow_dispatch, push, pull_request]
defaults:
run:
shell: bash

jobs:
docker_build:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Free up storage
run: |
df -h
./.github/cli-space-cleanup.sh
df -h
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
tags: ghcr.io/jordancarlin/cvw/ubuntu24cvw:latest
push: true
183 changes: 183 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: Installation
on: [workflow_dispatch, push]
defaults:
run:
shell: bash

jobs:
ubuntu_install:
name: Test installation on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Free up storage
run: |
df -h
./.github/cli-space-cleanup.sh
df -h
- name: install
run: sudo ./bin/wally-tool-chain-install.sh --clean
- name: Upload installation logs
uses: actions/upload-artifact@v4
if: always()
with:
name: installation-logs-${{ matrix.os }}
path: /opt/riscv/logs/
- name: make tests
run: |
source setup.sh
make riscof
- name: regression
run: |
source setup.sh
regression-wally
- name: Upload regression logs
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-logs-${{ matrix.os }}
path: ${{ github.workspace }}/sim/verilator/logs/

rhel_family_install:
name: Test installation on ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
options: --privileged --mount type=bind,source=/,target=/host --pid=host --entrypoint /bin/bash
strategy:
fail-fast: false
matrix:
os: ["rockylinux:8", "rockylinux:9", "almalinux:8", "almalinux:9"]
steps:
- name: Unique name for Artifacts
id: prep_artifact_name
run: |
name=$(echo -n "${{ matrix.os }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g')
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
- name: Install dependencies
run: |
dnf install -y sudo git
dnf install curl -y --allowerasing || true
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fix git ownership
run: git config --global --add safe.directory '*'
- name: Free up storage
run: |
df -h
nsenter -t 1 -m -u -n -i bash -c "$(cat .github/cli-space-cleanup.sh)"
df -h
- name: install
run: sudo ./bin/wally-tool-chain-install.sh --clean
- name: Upload installation logs
uses: actions/upload-artifact@v4
if: always()
with:
name: installation-logs-${{ env.ARTIFACT_NAME }}
path: /opt/riscv/logs/
- name: make tests
run: |
source setup.sh
make riscof
- name: regression
run: |
source setup.sh
regression-wally
- name: Upload regression logs
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-logs-${{ env.ARTIFACT_NAME }}
path: ${{ github.workspace }}/sim/verilator/logs/


user_install:
name: Test installation with user permissions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Free up storage
run: |
df -h
./.github/cli-space-cleanup.sh
df -h
- name: install packages with sudo
run: sudo ./bin/wally-package-install.sh
- name: install
run: ./bin/wally-tool-chain-install.sh --clean
- name: Upload installation logs
uses: actions/upload-artifact@v4
if: always()
with:
name: installation-logs-user-install
path: ~/riscv/logs/
- name: make tests
run: |
source setup.sh
make riscof
- name: regression
run: |
source setup.sh
regression-wally
- name: Upload regression logs
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-logs-user-install
path: ${{ github.workspace }}/sim/verilator/logs/


custom_location_install:
name: Test installation with custom location ${{ matrix.path }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
path: ["/home/riscv"]
steps:
- name: Unique name for Artifacts
id: prep_artifact_name
run: |
name=$(echo -n "${{ matrix.os }}" | sed -e 's/[ \t:\/\\"<>|*?]/-/g' -e 's/--*/-/g')
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Free up storage
run: |
df -h
./.github/cli-space-cleanup.sh
df -h
- name: install
run: sudo ./bin/wally-tool-chain-install.sh --clean ${{ matrix.path }}
- name: Upload instalation logs
uses: actions/upload-artifact@v4
if: always()
with:
name: installation-logs-custom-location-install-${{ env.ARTIFACT_NAME }}
path: ${{ matrix.path }}/logs/
- name: Update setup.sh with new $RISCV location
run: sed -i 's,exit 1,export RISCV=${{ matrix.path }},g' setup.sh
- name: make tests
run: |
source setup.sh
make riscof
- name: regression
run: |
source setup.sh
regression-wally
- name: Upload regression logs
uses: actions/upload-artifact@v4
if: always()
with:
name: regression-logs-custom-location-install-${{ env.ARTIFACT_NAME }}
path: ${{ github.workspace }}/sim/verilator/logs/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,4 @@ config/deriv
sim/slack-notifier/slack-webhook-url.txt
docs/docker/buildroot-config-src
docs/docker/testvector-generation
!.github/*
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# CVW Dockerfile
# Jordan Carlin [email protected] July 2024
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1

FROM ubuntu:24.04

SHELL ["/bin/bash", "-c"]

# Create a user with sudo privileges
ARG USERNAME=wally
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# Change to the new user
USER $USERNAME

COPY . /home/$USERNAME/cvw

WORKDIR /home/$USERNAME/cvw

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y \
&& apt-get install -y sudo git \
&& ./bin/wally-package-install.sh \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN sudo ./bin/wally-tool-chain-install.sh --clean

RUN source setup.sh \
&& git config --global --add safe.directory '*' \
&& make -j$(nproc)

CMD ["bash", "-c", "source setup.sh && exec /bin/bash"]
10 changes: 4 additions & 6 deletions bin/wally-package-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ if [ "$FAMILY" == rhel ]; then
SPIKE_PACKAGES+=(dtc boost-regex boost-system)
VERILATOR_PACKAGES+=(help2man perl clang ccache gperftools numactl mold)
BUILDROOT_PACKAGES+=(ncurses-base ncurses ncurses-libs ncurses-devel gcc-gfortran cpio) # gcc-gfortran is only needed for compiling spec benchmarks on buildroot linux
# Extra packages not availale in rhel8, nice for Verilator and needed for sail respectively
# Extra packages not availale in rhel8, nice for Verilator
if (( RHEL_VERSION >= 9 )); then
VERILATOR_PACKAGES+=(perl-doc)
SAIL_PACKAGES=(z3)
fi
# A newer version of gcc is required for qemu
OTHER_PACKAGES=(gcc-toolset-13)
Expand All @@ -80,7 +79,6 @@ elif [ "$FAMILY" == ubuntu ]; then
QEMU_PACKAGES+=(libfdt-dev libpixman-1-dev)
SPIKE_PACKAGES+=(device-tree-compiler libboost-regex-dev libboost-system-dev)
VERILATOR_PACKAGES+=(help2man perl g++ clang ccache libunwind-dev libgoogle-perftools-dev numactl perl-doc libfl2 libfl-dev zlib1g)
SAIL_PACKAGES+=(opam z3)
BUILDROOT_PACKAGES+=(ncurses-base ncurses-bin libncurses-dev gfortran cpio) # gfortran is only needed for compiling spec benchmarks on buildroot linux
VIVADO_PACKAGES+=(libncurses*) # Vivado hangs on the third stage of installation without this
fi
Expand All @@ -90,11 +88,11 @@ fi
if [ "${1}" == "--check" ]; then
section_header "Checking Dependencies from Package Manager"
if [ "$FAMILY" == rhel ]; then
for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${SAIL_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do
for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do
rpm -q "$pack" > /dev/null || (echo -e "${FAIL_COLOR}Missing packages detected (${WARNING_COLOR}$pack${FAIL_COLOR}). Run as root to auto-install or run wally-package-install.sh first.${ENDC}" && exit 1)
done
elif [ "$FAMILY" == ubuntu ]; then
for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${SAIL_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do
for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do
dpkg -l "$pack" | grep "ii" > /dev/null || (echo -e "${FAIL_COLOR}Missing packages detected (${WARNING_COLOR}$pack${FAIL_COLOR}). Run as root to auto-install or run wally-package-install.sh first." && exit 1)
done
fi
Expand Down Expand Up @@ -124,6 +122,6 @@ else
# Update and Upgrade tools
eval "$UPDATE_COMMAND"
# Install packages listed above using appropriate package manager
sudo $PACKAGE_MANAGER install -y "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${SAIL_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}" "${VIVADO_PACKAGES[@]}"
sudo $PACKAGE_MANAGER install -y "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}" "${VIVADO_PACKAGES[@]}"
echo -e "${SUCCESS_COLOR}Packages successfully installed.${ENDC}"
fi
Loading
Loading