-
Notifications
You must be signed in to change notification settings - Fork 23
Dockerfile: add tsffs-dev target #169
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dcac519
Dockerfile: add tsffs-dev target
Wenzel 66e5ff2
add DevContainer
Wenzel 37b2c26
Dockerfile: add tsffs-prod target
Wenzel d5c2cfd
Dockerfile: ignore hadolint error
Wenzel 513a8c2
ci: add check_docker_image for voth targets
Wenzel d738385
Dockerfile: specify simics vars through build-time variables with def…
Wenzel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,23 @@ | ||
| { | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "target": "tsffs-dev" | ||
| }, | ||
| "remoteUser": "vscode", | ||
| "updateRemoteUserUID": true, | ||
| "runArgs": [ | ||
| "--group-add", | ||
| "dev" | ||
| ], | ||
| "workspaceMount": "source=${localWorkspaceFolder},target=/workspace/tsffs,type=bind", | ||
| "workspaceFolder": "/workspace/tsffs", | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "rust-lang.rust-analyzer", | ||
| "tamasfe.even-better-toml", | ||
| "ms-azuretools.vscode-containers" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -2,13 +2,13 @@ | |
| # SPDX-License-Identifier: Apache-2.0 | ||
| # hadolint global ignore=DL3041,DL3040 | ||
|
|
||
| FROM fedora:42@sha256:ee88ab8a5c8bf78687ddcecadf824767e845adc19d8cdedb56f48521eb162b43 | ||
| FROM fedora:42@sha256:ee88ab8a5c8bf78687ddcecadf824767e845adc19d8cdedb56f48521eb162b43 AS tsffs-base | ||
|
|
||
| # Download links can be obtained from: | ||
| # https://lemcenter.intel.com/productDownload/?Product=256660e5-a404-4390-b436-f64324d94959 | ||
| ENV PUBLIC_SIMICS_PKGS_URL="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/simics-6-packages-2024-05-linux64.ispm" | ||
| ENV PUBLIC_SIMICS_ISPM_URL="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/intel-simics-package-manager-1.8.3-linux64.tar.gz" | ||
| ENV PUBLIC_SIMICS_PACKAGE_VERSION_1000="6.0.185" | ||
| ARG PUBLIC_SIMICS_PKGS_URL="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/simics-6-packages-2024-05-linux64.ispm" | ||
| ARG PUBLIC_SIMICS_ISPM_URL="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ead79ef5-28b5-48c7-8d1f-3cde7760798f/intel-simics-package-manager-1.8.3-linux64.tar.gz" | ||
| ARG PUBLIC_SIMICS_PACKAGE_VERSION_1000="6.0.185" | ||
| ENV SIMICS_BASE="/workspace/simics/simics-${PUBLIC_SIMICS_PACKAGE_VERSION_1000}/" | ||
| # Add cargo and ispm to the path | ||
| ENV PATH="/root/.cargo/bin:/workspace/simics/ispm:${PATH}" | ||
|
|
@@ -124,3 +124,49 @@ RUN ispm projects /workspace/projects/example/ --create \ | |
| ninja | ||
|
|
||
| RUN echo 'echo "To run the demo, run ./simics -no-gui --no-win fuzz.simics"' >> /root/.bashrc | ||
|
|
||
| FROM tsffs-base AS tsffs-dev | ||
| ARG USER_UID=1000 | ||
| ARG USERNAME=vscode | ||
|
|
||
| # To build and run the dev image: | ||
| # docker build --build-arg USER_UID=$(id -u) --target tsffs-dev -t tsffs:dev . | ||
| # docker run --rm -ti -v .:/workspace/tsffs tsffs:dev | ||
|
|
||
| # hadolint ignore=DL3004,SC3009 | ||
| RUN <<EOF | ||
| set -e | ||
| # create group for developers | ||
| groupadd dev | ||
| # Create group and user with a home at /home/vscode | ||
| useradd \ | ||
| --create-home \ | ||
| --uid $USER_UID \ | ||
| --user-group \ | ||
| --groups dev \ | ||
| --shell /bin/bash \ | ||
| $USERNAME \ | ||
| && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME | ||
|
|
||
| # set /workspace/simics permissions to root:dev | ||
| chown -R root:dev /workspace/{simics,projects} && chmod -R g+w /workspace/{simics,projects} | ||
|
|
||
| # install Rust nightly for the user | ||
| sudo -E -u $USERNAME bash -c 'curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain none' | ||
|
||
|
|
||
| # copy Simics ISPM config | ||
| mkdir -p /home/$USERNAME/.config | ||
| cp -r "/root/.config/Intel Simics Package Manager/" "/home/$USERNAME/.config/" | ||
| chown -R $USERNAME:$USERNAME "/home/$USERNAME/.config/" | ||
| EOF | ||
|
|
||
| WORKDIR /workspace/tsffs | ||
|
|
||
| FROM fedora:42@sha256:ee88ab8a5c8bf78687ddcecadf824767e845adc19d8cdedb56f48521eb162b43 AS tsffs-prod | ||
|
|
||
| COPY --from=tsffs-base /workspace/projects /workspace/projects | ||
| COPY --from=tsffs-base /workspace/simics /workspace/simics | ||
| COPY --from=tsffs-base /root/.bashrc /root/.bashrc | ||
| COPY --from=tsffs-base /root/.cargo /root/.cargo | ||
|
|
||
| WORKDIR /workspace/projects/example | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Setting group write permissions recursively on /workspace/{simics,projects} may be overly permissive. Consider limiting write access to specific subdirectories that need modification.