-
Notifications
You must be signed in to change notification settings - Fork 213
Replace jetkvm_native binary with cgo #635
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 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
83b0c79
feat: move native binary to cgo
ym 713becd
feat: add supervisor and error dump
ym c166602
make docker build enabled by default
ym 99a05db
add lock to usb state
ym dd90321
change no network screen height
ym 3eb8139
hide cloud account id
ym 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 |
---|---|---|
@@ -1,27 +1,38 @@ | ||
{ | ||
"name": "JetKVM", | ||
"image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm", | ||
"image": "mcr.microsoft.com/devcontainers/go:1.25-trixie", | ||
"features": { | ||
"ghcr.io/devcontainers/features/node:1": { | ||
// Should match what is defined in ui/package.json | ||
"version": "22.15.0" | ||
"version": "22.19.0" | ||
} | ||
}, | ||
"mounts": [ | ||
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" | ||
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" | ||
], | ||
"onCreateCommand": ".devcontainer/install-deps.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"bradlc.vscode-tailwindcss", | ||
// coding styles | ||
"chrislajoie.vscode-modelines", | ||
"editorconfig.editorconfig", | ||
// GitHub | ||
"GitHub.vscode-pull-request-github", | ||
"dbaeumer.vscode-eslint", | ||
"github.vscode-github-actions", | ||
// Golang | ||
"golang.go", | ||
// C / C++ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cpptools-extension-pack", | ||
// CMake / Makefile | ||
"ms-vscode.makefile-tools", | ||
"ms-vscode.cmake-tools", | ||
// Frontend | ||
"esbenp.prettier-vscode", | ||
"github.vscode-github-actions" | ||
"dbaeumer.vscode-eslint", | ||
"bradlc.vscode-tailwindcss" | ||
] | ||
} | ||
} | ||
} | ||
|
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,35 @@ | ||
#!/bin/bash | ||
|
||
SUDO_PATH=$(which sudo) | ||
function sudo() { | ||
if [ "$UID" -eq 0 ]; then | ||
"$@" | ||
else | ||
${SUDO_PATH} "$@" | ||
fi | ||
} | ||
|
||
set -ex | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update && \ | ||
sudo apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
device-tree-compiler \ | ||
gperf g++-multilib gcc-multilib \ | ||
libnl-3-dev libdbus-1-dev libelf-dev libmpc-dev dwarves \ | ||
bc openssl flex bison libssl-dev python3 python-is-python3 texinfo kmod cmake \ | ||
wget zstd \ | ||
python3-venv python3-kconfiglib \ | ||
&& sudo rm -rf /var/lib/apt/lists/* | ||
|
||
# Install buildkit | ||
BUILDKIT_VERSION="v0.2.5" | ||
BUILDKIT_TMPDIR="$(mktemp -d)" | ||
pushd "${BUILDKIT_TMPDIR}" > /dev/null | ||
|
||
wget https://github.com/jetkvm/rv1106-system/releases/download/${BUILDKIT_VERSION}/buildkit.tar.zst && \ | ||
sudo mkdir -p /opt/jetkvm-native-buildkit && \ | ||
sudo tar --use-compress-program="unzstd --long=31" -xvf buildkit.tar.zst -C /opt/jetkvm-native-buildkit && \ | ||
rm buildkit.tar.zst | ||
popd |
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 |
---|---|---|
|
@@ -16,28 +16,48 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v5 | ||
- name: Set up docker image context | ||
run: | | ||
./scripts/ci_helper.sh prepare | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ${{ env.DOCKER_BUILD_CONTEXT_DIR }} | ||
file: ${{ env.DOCKER_BUILD_CONTEXT_DIR }}/Dockerfile.build | ||
tags: ${{ env.DOCKER_BUILD_TAG }} | ||
push: false | ||
load: true | ||
- name: Set up Cmake cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: internal/native/cgo/build | ||
key: jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }} | ||
restore-keys: | | ||
jetkvm-cgo-${{ hashFiles('internal/native/cgo/**/*.c', 'internal/native/cgo/**/*.h', 'internal/native/cgo/**/*.patch', 'internal/native/cgo/**/*.txt', 'internal/native/cgo/**/*.sh', '!internal/native/cgo/build/**') }} | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v5 | ||
with: | ||
node-version: "22" | ||
cache: "npm" | ||
cache-dependency-path: "**/package-lock.json" | ||
- name: Set up Golang | ||
uses: actions/setup-go@v5 | ||
uses: actions/setup-go@v6.0.0 | ||
with: | ||
go-version: "1.24.4" | ||
go-version: "^1.25.1" | ||
- name: Build frontend | ||
run: | | ||
make frontend | ||
- name: Build application | ||
- name: Build application inside Docker container | ||
run: | | ||
make build_dev | ||
./scripts/ci_helper.sh make build_dev | ||
- name: Run tests | ||
run: | | ||
go test ./... -json > testreport.json | ||
- name: Make test cases | ||
run: | | ||
make build_dev_test | ||
./scripts/ci_helper.sh make build_dev_test | ||
- name: Golang Test Report | ||
uses: becheran/[email protected] | ||
with: | ||
|
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"tailwindCSS.classFunctions": ["cva", "cx"] | ||
"tailwindCSS.classFunctions": [ | ||
"cva", | ||
"cx" | ||
], | ||
"git.ignoreLimitWarning": true | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM --platform=${BUILDPLATFORM} golang:1.25.1-trixie AS builder | ||
|
||
ENV GOTOOLCHAIN=local | ||
ENV GOPATH=/go | ||
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH | ||
|
||
COPY install-deps.sh /install-deps.sh | ||
RUN /install-deps.sh | ||
|
||
# Create build directory | ||
RUN mkdir -p /build/ | ||
|
||
# Copy go.mod and go.sum | ||
COPY go.mod go.sum /build/ | ||
|
||
WORKDIR /build | ||
|
||
RUN go mod download && go mod verify | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] |
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
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.
Uh oh!
There was an error while loading. Please reload this page.