-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32c60f0
commit d7a5b57
Showing
17 changed files
with
2,275 additions
and
11 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
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,2 @@ | ||
DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_INSTALL_PREFIX=/opt/remus |
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,17 @@ | ||
# Ubuntu 22.04 | ||
FROM ubuntu:jammy | ||
|
||
RUN apt-get update -y && \ | ||
apt-get upgrade -y | ||
|
||
# Move to the working directory | ||
COPY . . | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
# Install the required packages + isolating ca-certificates for debugging purposes | ||
RUN apt-get install --no-install-recommends -y ca-certificates && \ | ||
apt-get install --no-install-recommends -y $(cat req.list) && \ | ||
# Clean up to free up additional disk space | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR "/root" |
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,37 @@ | ||
# Notes for building your environment | ||
|
||
The **build.sh** script will automatically adjust to your computer architecture - no need to modify this script. | ||
|
||
## For MAC (M1/M2, M3) | ||
|
||
**Disable the Roseta Desktop feature in Docker** | ||
As of 06-2024 there is a bug in the experimental features of Rosetta Desketop that causes an illegal instruction in | ||
the x86_64 emulation of ca-certificates. The dpkg post-installation triggers will cause the build to fail if this feature is not disabled. | ||
|
||
Settings > General > `Use Rosetta for x86_64/amd64 emulation on Apple Silicon` | ||
Uncheck this. | ||
|
||
Now build your environment: | ||
`chmod +x build.sh && ./build.sh` | ||
|
||
## For x86_64 | ||
|
||
Build your environment: | ||
`chmod +x build.sh && ./build.sh` | ||
|
||
## Running the container | ||
|
||
This should give you root access to the build image. | ||
`chmod +x run.sh && ./run.sh` | ||
|
||
## Building the source code | ||
|
||
`chmod +x build_local.sh && ./build_local.sh` | ||
|
||
## Debugging | ||
|
||
Modify the following to the Dockerfile if you run into issues with the build: | ||
`RUN apt-get -o Debug::pkgProblemResolver=true install --no-install-recommends -y ca-certificates` | ||
|
||
This will automatically be flushed to stdout. To see more Docker-specific issues, please see: | ||
`docker logs <container-id>` |
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,47 @@ | ||
#!/usr/bin/env bash | ||
GREEN=$(tput setaf 2) | ||
NC=$(tput sgr0) | ||
|
||
architecture=$(uname -m) | ||
BUILDER="builder" | ||
|
||
check_success() { | ||
if [ $? -ne 0 ]; then | ||
echo "Error: $1 failed" | ||
exit 1 | ||
else | ||
echo "${GREEN}$1 successful.${NC}" | ||
fi | ||
} | ||
|
||
# Check for the existance of the builder context | ||
if docker buildx ls | grep -q $BUILDER; then | ||
echo "Builder context already exists." | ||
docker buildx rm $BUILDER | ||
check_success "docker buildx rm" | ||
echo "Rebuilding..." | ||
else | ||
echo "Builder context does not yet exist." | ||
fi | ||
# Regardless we are building a fresh context | ||
docker buildx create --name $BUILDER --use | ||
check_success "docker buildx create" | ||
|
||
# Inspecting build context for cross compilation | ||
docker buildx inspect --bootstrap | ||
check_success "docker buildx inspect" | ||
|
||
# Ensure binfmt is installed | ||
docker run --rm --privileged tonistiigi/binfmt --install all | ||
check_success "installing binfmt" | ||
|
||
echo "Building for $architecture..." | ||
if [[ "$architecture" == "arm64" ]]; then | ||
# We use buildx to build for arm64 | ||
docker buildx build --no-cache --platform linux/amd64 -t remus:latest --load . | ||
elif [[ "$architecture" == "x86_64" ]]; then | ||
docker build --no-cache -t remus:latest --load . | ||
else | ||
echo "Unknown architecture $architecture." | ||
fi | ||
|
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd /root | ||
rm -rf build | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make |
Oops, something went wrong.