Skip to content

Commit

Permalink
Update infrastructure and reference container
Browse files Browse the repository at this point in the history
  • Loading branch information
JonatanAntoni committed Nov 13, 2023
1 parent 973dbb1 commit f9c2c0c
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 26 deletions.
44 changes: 33 additions & 11 deletions .devcontainer/ubuntu-22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,58 @@ FROM --platform=linux/amd64 ubuntu:22.04

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

ARG USERNAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get -y install \
build-essential \
curl \
gdb \
gh \
git \
less \
libncurses5 \
libtinfo5 \
llvm-15-tools \
locales \
nano \
python3 \
python3-pip \
python-is-python3 \
git \
libtinfo5 \
llvm-15-tools \
software-properties-common \
sudo \
unzip && \
ln -s /usr/bin/FileCheck-15 /usr/bin/FileCheck

RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get -y install libpython3.9

RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen

RUN pip install \
lit \
python-matrix-runner

RUN bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" && \
sed -i 's/OSH_THEME="font"/OSH_THEME="powerline"/' ~/.bashrc
# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

RUN mkdir -p /workspaces && \
chown $USER_UID:$USER_GID /workspaces

ADD vcpkg-configuration.json /home/
ADD postCreateCommand.sh /home/

ADD vcpkg-configuration.json /root/
RUN chmod +x /home/postCreateCommand.sh

RUN pushd /root && \
. <(curl https://aka.ms/vcpkg-init.sh -L) && \
echo "\n# Initialize vcpkg\n. /root/.vcpkg/vcpkg-init" >> .bashrc && \
vcpkg x-update-registry --all && \
vcpkg activate
USER $USERNAME
WORKDIR /home/$USERNAME

CMD ["/bin/bash"]
15 changes: 13 additions & 2 deletions .devcontainer/ubuntu-22.04/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"name": "Ubuntu-22.04",
"build": { "dockerfile": "Dockerfile" },

"build": {
"dockerfile": "Dockerfile",
"args": {
"USERNAME": "${localEnv:USER}"
}
},
"mounts": [
"source=${devcontainerId}-home,target=/home/${localEnv:USER},type=volume",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/${localEnv:USER}/.ssh,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.armlm,target=/home/${localEnv:USER}/.armlm,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.iarlm,target=/home/${localEnv:USER}/.iarlm,type=bind,consistency=cached"
],
"postCreateCommand": "/home/postCreateCommand.sh",
"customizations": {
"vscode": {
"extensions": [
Expand Down
14 changes: 14 additions & 0 deletions .devcontainer/ubuntu-22.04/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

echo "Installing oh-my-bash ..."
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" --unattended
sed -i 's/OSH_THEME="font"/OSH_THEME="powerline"/' ~/.bashrc

echo "Bootstrapping vcpkg ..."
# shellcheck source=/dev/null
. <(curl -sL https://aka.ms/vcpkg-init.sh)
grep -q "vcpkg-init" ~/.bashrc || echo -e "\n# Initialize vcpkg\n. ~/.vcpkg/vcpkg-init" >> ~/.bashrc && \
pushd "$(dirname "$0")" || exit
vcpkg x-update-registry --all
vcpkg activate
popd || exit
4 changes: 3 additions & 1 deletion .devcontainer/ubuntu-22.04/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
}
],
"requires": {
"microsoft:tools/kitware/cmake": "^3.25.2",
"microsoft:ninja": "^1.10.2",
"arm:compilers/arm/armclang":"^6.20.0",
"arm:compilers/arm/arm-none-eabi-gcc": "^12.2.1-0",
"arm:compilers/arm/llvm-embedded": "^17.0.1-0",
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.1.0-0",
"arm:models/arm/avh": "^11.21.15"
"arm:models/arm/avh-fvp": "^11.22.39",
"arm:debuggers/arm/armdbg": "^6.0.0"
}
}

11 changes: 0 additions & 11 deletions .github/workflows/corevalidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ jobs:
. <(curl https://aka.ms/vcpkg-init.sh -L)
vcpkg x-update-registry --all
vcpkg activate
echo "Fix library search path for VHT models"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(dirname $(which VHT_MPS2_Cortex-M3))" >> $GITHUB_ENV
echo "Fix execute permissions for VHT models"
chmod +x $(dirname $(which VHT_MPS2_Cortex-M3))/VHT_*
echo "Patch CMSIS-Toolbox"
pushd $(dirname $(which cbuild))/../etc
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/CLANG.17.0.1.cmake
popd
- name: Activate Arm tool license
working-directory: ./CMSIS/CoreValidation/Project
Expand Down
3 changes: 2 additions & 1 deletion CMSIS/CoreValidation/Project/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
}
],
"requires": {
"microsoft:tools/kitware/cmake": "^3.25.2",
"microsoft:ninja": "^1.10.2",
"arm:compilers/arm/armclang":"^6.20.0",
"arm:compilers/arm/arm-none-eabi-gcc": "^12.2.1-0",
"arm:compilers/arm/llvm-embedded": "^17.0.1-0",
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.1.0-0",
"arm:models/arm/avh": "^11.21.15",
"arm:models/arm/avh-fvp": "^11.22.39",
"arm:debuggers/arm/armdbg": "^6.0.0"
}
}
Expand Down

0 comments on commit f9c2c0c

Please sign in to comment.