-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michal Czyz <[email protected]>
- Loading branch information
1 parent
16a7194
commit 0d2b2a0
Showing
14 changed files
with
314 additions
and
6 deletions.
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,10 @@ | ||
{ | ||
"image": "ghcr.io/antmicro/openroad-codespace:lxqt", | ||
"forwardPorts": [6080], | ||
"portsAttributes": { | ||
"6080": { | ||
"label": "desktop" | ||
} | ||
}//, | ||
// "onCreateCommand": "bash /workspaces/openroad-codespace/update-config.sh" | ||
} |
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
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,55 @@ | ||
name: Prebuild docker image | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
jobs: | ||
build: | ||
name: BUILD | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 600 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: "mczyz/dev" | ||
|
||
- name: Login to GitHub Container Registry (GHCR) | ||
if: github.event_name != 'pull_request' && github.repository == 'antmicro/openroad-codespace' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: gha | ||
password: ${{ github.token }} | ||
|
||
- name: Docker build | ||
run: | | ||
docker build -t ghcr.io/antmicro/openroad-codespace:orfs -f Dockerfile-orfs . | ||
- name: Push container image to GitHub Container Registry (GHCR) | ||
if: github.event_name != 'pull_request' && github.repository == 'antmicro/openroad-codespace' | ||
run: docker push ghcr.io/antmicro/openroad-codespace:orfs | ||
|
||
- name: Devcontainer build | ||
run: | | ||
npm install -g @devcontainers/cli | ||
devcontainer build --config .devcontainer/ubuntu-gui/devcontainer.json --workspace-folder . --push false --image-name ghcr.io/antmicro/openroad-codespace:desktop | ||
# docker image tag test:latest ghcr.io/antmicro/openroad-codespace:test | ||
- name: Push container image to GitHub Container Registry (GHCR) | ||
if: github.event_name != 'pull_request' && github.repository == 'antmicro/openroad-codespace' | ||
run: docker push ghcr.io/antmicro/openroad-codespace:desktop | ||
|
||
- name: Docker build | ||
run: | | ||
docker build -t ghcr.io/antmicro/openroad-codespace:lxqt -f Dockerfile-lxqt . | ||
- name: Push container image to GitHub Container Registry (GHCR) | ||
if: github.event_name != 'pull_request' && github.repository == 'antmicro/openroad-codespace' | ||
run: docker push ghcr.io/antmicro/openroad-codespace:lxqt |
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,4 @@ | ||
FROM ghcr.io/antmicro/openroad-codespace:desktop | ||
|
||
COPY ./scripts/install-lxqt.sh /usr/local/bin/install-lxqt.sh | ||
RUN bash /usr/local/bin/install-lxqt.sh |
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,6 @@ | ||
FROM ubuntu:22.04 | ||
|
||
COPY ./scripts/install.sh /usr/local/bin/install.sh | ||
RUN bash /usr/local/bin/install.sh | ||
|
||
ENV PATH="$PATH:/opt/oss-cad-suite/bin" |
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
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,72 @@ | ||
# Base file is from devcontainers/features/desktop-lite/install.sh | ||
# Original file is licensed as MIT | ||
# Applied modifications to the script 2024 | ||
|
||
user_name="root" | ||
group_name="root" | ||
LOG=/tmp/container-init.log | ||
|
||
export DBUS_SESSION_BUS_ADDRESS="autolaunch:" | ||
export DISPLAY=":1" | ||
export VNC_RESOLUTION="1920x1080x32" | ||
export LANG="en_US.UTF-8" | ||
export LANGUAGE="en_US.UTF-8" | ||
|
||
# Try to kill pid based on name | ||
kill_pid() | ||
{ | ||
PIDS_TO_KILL=$(ps axjf | grep $1 | awk '{print $2}') | ||
for PID in ${PIDS_TO_KILL[@]}; do | ||
echo "Attempting to kill $PID" | ||
kill -9 $PID | ||
done | ||
} | ||
|
||
# Execute the command it not already running | ||
startInBackgroundIfNotRunning() | ||
{ | ||
log "Starting $1." | ||
echo -e "\n** $(date) **" | sudoIf tee -a /tmp/$1.log > /dev/null | ||
if ! pgrep -x $1 > /dev/null; then | ||
keepRunningInBackground "$@" | ||
while ! pgrep -x $1 > /dev/null; do | ||
sleep 1 | ||
done | ||
log "$1 started." | ||
else | ||
echo "$1 is already running." | sudoIf tee -a /tmp/$1.log > /dev/null | ||
log "$1 is already running." | ||
fi | ||
} | ||
|
||
# Keep command running in background | ||
keepRunningInBackground() | ||
{ | ||
($2 bash -c "while :; do echo [\$(date)] Process started.; $3; echo [\$(date)] Process exited!; sleep 5; done 2>&1" | sudoIf tee -a /tmp/$1.log > /dev/null & echo "$!" | sudoIf tee /tmp/$1.pid > /dev/null) | ||
} | ||
|
||
# Use sudo to run as root when required | ||
sudoIf() | ||
{ | ||
if [ "$(id -u)" -ne 0 ]; then | ||
sudo "$@" | ||
else | ||
"$@" | ||
fi | ||
} | ||
|
||
# Use sudo to run as non-root user if not already running | ||
sudoUserIf() | ||
{ | ||
if [ "$(id -u)" -eq 0 ] && [ "${user_name}" != "root" ]; then | ||
sudo -u ${user_name} "$@" | ||
else | ||
"$@" | ||
fi | ||
} | ||
|
||
# Log messages | ||
log() | ||
{ | ||
echo -e "[$(date)] $@" | sudoIf tee -a $LOG > /dev/null | ||
} |
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,38 @@ | ||
#!/bin/bash | ||
|
||
. ./common.sh | ||
|
||
log "** SCRIPT START **" | ||
|
||
# Start dbus. | ||
log 'Running "/etc/init.d/dbus start".' | ||
if [ -f "/var/run/dbus/pid" ] && ! pgrep -x dbus-daemon > /dev/null; then | ||
sudoIf rm -f /var/run/dbus/pid | ||
fi | ||
sudoIf /etc/init.d/dbus start 2>&1 | sudoIf tee -a /tmp/dbus-daemon-system.log > /dev/null | ||
while ! pgrep -x dbus-daemon > /dev/null; do | ||
sleep 1 | ||
done | ||
|
||
# Startup tigervnc server and fluxbox | ||
sudoIf rm -rf /tmp/.X11-unix /tmp/.X*-lock | ||
mkdir -p /tmp/.X11-unix | ||
sudoIf chmod 1777 /tmp/.X11-unix | ||
sudoIf chown root:${group_name} /tmp/.X11-unix | ||
if [ "$(echo "${VNC_RESOLUTION}" | tr -cd 'x' | wc -c)" = "1" ]; then VNC_RESOLUTION=${VNC_RESOLUTION}x16; fi | ||
screen_geometry="${VNC_RESOLUTION%*x*}" | ||
screen_depth="${VNC_RESOLUTION##*x}" | ||
startInBackgroundIfNotRunning "Xtigervnc" sudoUserIf "tigervncserver ${DISPLAY} -geometry ${screen_geometry} -depth ${screen_depth} -rfbport 5901 -dpi ${VNC_DPI:-96} -localhost -desktop fluxbox -fg" -passwd /usr/local/etc/vscode-dev-containers/vnc-passwd | ||
|
||
# Spin up noVNC if installed and not running. | ||
if [ -d "/usr/local/novnc" ] && [ "$(ps -ef | grep /usr/local/novnc/noVNC*/utils/launch.sh | grep -v grep)" = "" ]; then | ||
keepRunningInBackground "noVNC" sudoIf "/usr/local/novnc/noVNC*/utils/launch.sh --listen 6080 --vnc localhost:5901" | ||
log "noVNC started." | ||
else | ||
log "noVNC is already running or not installed." | ||
fi | ||
|
||
# Run whatever was passed in | ||
log "Executing \"$@\"." | ||
exec "$@" | ||
log "** SCRIPT EXIT **" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Create session config file | ||
apt-get update | ||
apt-get -y --no-install-recommends install lxqt | ||
|
||
mkdir -p ~/.config/lxqt/ | ||
touch ~/.config/lxqt/session.conf | ||
|
||
cat << EOF > ~/.config/lxqt/session.conf | ||
[General] | ||
__userfile__=true | ||
window_manager=xfwm4 | ||
EOF |
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 @@ | ||
#!/bin/bash | ||
|
||
export KLAYOUT_VER=${KLAYOUT_VER:-0.28.17-1} | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
apt-get -qqy update | ||
apt-get install -qqy --no-install-recommends git wget ca-certificates | ||
|
||
update-ca-certificates | ||
wget https://www.klayout.org/downloads/Ubuntu-22/klayout_${KLAYOUT_VER}_amd64.deb | ||
apt-get install -qqy --no-install-recommends ./klayout_${KLAYOUT_VER}_amd64.deb | ||
rm -rf ./klayout_${KLAYOUT_VER}_amd64.deb | ||
|
||
wget https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2024-03-26/oss-cad-suite-linux-x64-20240326.tgz | ||
tar -xvf oss-cad-suite-linux-x64-20240326.tgz | ||
rm -rf oss-cad-suite-linux-x64-20240326.tgz | ||
mkdir -p /opt | ||
mv oss-cad-suite /opt/oss-cad-suite | ||
|
||
wget https://github.com/Precision-Innovations/OpenROAD/releases/download/2024-03-25/openroad_2.0_amd64-ubuntu22.04-2024-03-25.deb | ||
apt-get install -qqy --no-install-recommends ./openroad_2.0_amd64-ubuntu22.04-2024-03-25.deb | ||
rm -rf ./openroad_2.0_amd64-ubuntu22.04-2024-03-25.deb | ||
|
||
cd ~ | ||
git clone https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git | ||
|
||
apt-get clean | ||
apt-get autoclean |
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,69 @@ | ||
#!/bin/bash | ||
|
||
. ./common.sh | ||
|
||
# Attempt to change default shell | ||
chsh -s /bin/bash | ||
|
||
# Install Konsole | ||
|
||
# apt-get update | ||
# sudoIf apt-get -y install gnome-terminal | ||
|
||
# # Update fluxbox config | ||
|
||
# fluxbox_apps="$(cat \ | ||
# << 'EOF' | ||
# [transient] (role=GtkFileChooserDialog) | ||
# [Dimensions] {100% 100%} | ||
# [Position] (CENTER) {0 0} | ||
# [end] | ||
# EOF | ||
# )" | ||
|
||
# echo "${fluxbox_apps}" > ~/.fluxbox/apps | ||
|
||
# fluxbox_menu="$(cat \ | ||
# << 'EOF' | ||
# [begin] ( Application Menu ) | ||
# [exec] (File Manager) { nautilus ~ } <> | ||
# [exec] (Text Editor) { mousepad } <> | ||
# [exec] (Terminal) { gnome-terminal /bin/bash } <> | ||
# [exec] (Web Browser) { x-www-browser --disable-dev-shm-usage } <> | ||
# [submenu] (System) {} | ||
# [exec] (Set Resolution) { tilix -t "Set Resolution" -e bash /usr/local/bin/set-resolution } <> | ||
# [exec] (Edit Application Menu) { mousepad ~/.fluxbox/menu } <> | ||
# [exec] (Passwords and Keys) { seahorse } <> | ||
# [exec] (Top Processes) { tilix -t "Top" -e htop } <> | ||
# [exec] (Disk Utilization) { tilix -t "Disk Utilization" -e ncdu / } <> | ||
# [exec] (Editres) {editres} <> | ||
# [exec] (Xfontsel) {xfontsel} <> | ||
# [exec] (Xkill) {xkill} <> | ||
# [exec] (Xrefresh) {xrefresh} <> | ||
# [end] | ||
# [config] (Configuration) | ||
# [workspaces] (Workspaces) | ||
# [end] | ||
# EOF | ||
# )" | ||
|
||
# echo "${fluxbox_menu}" > ~/.fluxbox/menu | ||
|
||
# kill_pid tigervncserver | ||
# kill_pid novnc | ||
|
||
# ps axjf | grep tigervncserver | ||
# ps axjf | grep novnc | ||
|
||
# bash desktop-update.sh | ||
|
||
# Create session config file | ||
sudoIf apt-get -y --no-install-recommends install lxqt | ||
|
||
cat << EOF > ~/.config/lxqt/session.conf | ||
[General] | ||
__userfile__=true | ||
window_manager=xfwm4 | ||
EOF | ||
# | ||
|