Skip to content
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

[feature]: new container runtime #2512

Merged
merged 139 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from 138 commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
7a31d09
feature: Include the start init files.
Blu-J Aug 17, 2023
40b19c5
chore: Remove the long running from the docker
Blu-J Nov 8, 2023
18cd6c8
chore: Make sure the test is testing something is correct shape
Blu-J Nov 8, 2023
b5da076
chore: Add in some modifications to make the sandboxed and execute in…
Blu-J Nov 9, 2023
94d22ed
chore: Remove the other procedures since all are now via the js
Blu-J Nov 10, 2023
38a624f
chore: Remove the todoes that we have done.
Blu-J Nov 13, 2023
a36ab71
chore: Add some more comments for DrBones
Blu-J Nov 13, 2023
e8684cb
Merge branch 'feature/start_init' into chore/removing-non-long-running
Blu-J Nov 13, 2023
46f594a
chore: Add in the changes that where discussed with @Dr_Bonez in the …
Blu-J Nov 13, 2023
fcdc642
Merge branch 'next/minor' of github.com:Start9Labs/start-os into chor…
dr-bonez Nov 13, 2023
5f40d94
move container init system to project root
dr-bonez Nov 13, 2023
5c578c0
Merge branch 'next/minor' of github.com:Start9Labs/start-os into inte…
dr-bonez Nov 13, 2023
0e2fc07
remove js-engine
dr-bonez Nov 13, 2023
c988bca
Merge branch 'next/minor' of github.com:Start9Labs/start-os into inte…
dr-bonez Nov 13, 2023
069db28
Merge branch 'next/minor' of github.com:Start9Labs/start-os into inte…
dr-bonez Nov 17, 2023
11a2e96
Merge branch 'next/minor' of github.com:Start9Labs/start-os into inte…
dr-bonez Nov 17, 2023
65009e2
Merge branch 'next/minor' of github.com:Start9Labs/start-os into inte…
dr-bonez Nov 20, 2023
fab13db
Feature/lxc container runtime (#2514)
dr-bonez Feb 17, 2024
eae75c1
update network interfaces types
MattDHill Feb 17, 2024
d7bc7a2
make service interfaces and hosts one to one
MattDHill Feb 19, 2024
089199e
Feature/lxc container runtime (#2562)
dr-bonez Feb 22, 2024
39964bf
Feature/lxc container runtime (#2563)
dr-bonez Feb 22, 2024
3bd7596
chore: Fix some issues in the installation of a package and other rpc…
Blu-J Feb 22, 2024
87d6684
Frontend changes for 036 (#2554)
MattDHill Feb 23, 2024
4e3075a
chore: Add in the ability to remove the bad sections?
Blu-J Feb 23, 2024
50f0ead
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Feb 23, 2024
d87748f
add npm workspace file
dr-bonez Feb 26, 2024
ddeed65
remove workspace package json
dr-bonez Feb 27, 2024
6b990e1
chore: Up the version
Blu-J Feb 27, 2024
2f6d7ac
chore: Update to have the startsdk
Blu-J Feb 27, 2024
0b4b091
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Feb 27, 2024
f50ddb4
chore: somethinng
Blu-J Feb 27, 2024
171e0ed
chore: Something
Blu-J Feb 27, 2024
5366b4c
chore: Add another export
Blu-J Feb 27, 2024
11c9323
fix: Let the service be able to be started
Blu-J Mar 4, 2024
8802841
chore: Add some documentation for the service actor seed
Blu-J Mar 4, 2024
093a5d4
chore: Simplify the state into one
Blu-J Mar 6, 2024
8410929
feat: Add the stop/start loop for the service
Blu-J Mar 6, 2024
f3ccad1
chore: Add the process tree destroyer
Blu-J Mar 6, 2024
14be2fa
chore: Add in the ability to kill the tree of processes
Blu-J Mar 6, 2024
efbbaa5
feat: Get the health checks for the js
Blu-J Mar 7, 2024
328beab
chore: Add in the possibility to get the status code from the execute…
Blu-J Mar 7, 2024
a17ec42
chore: Remove some of the bad logging
Blu-J Mar 7, 2024
e0c9f8a
Feature/remove postgres (#2570)
dr-bonez Mar 7, 2024
31ea0fe
fix async cycle
dr-bonez Mar 7, 2024
2e7c3bf
use dockerhub compat
dr-bonez Mar 7, 2024
8665342
fix deadlock
dr-bonez Mar 7, 2024
d986bd2
sync ssh keys on add
dr-bonez Mar 8, 2024
4a28522
chore: Update the version of the cargo
Blu-J Mar 8, 2024
99bb55a
Update some of the types
Blu-J Mar 11, 2024
dc3dc4a
chore: Update some of the system for the embassy properties to be fil…
Blu-J Mar 11, 2024
1308b5b
wait up to 30s for ip address
dr-bonez Mar 11, 2024
64fb002
Merge branch 'integration/new-container-runtime' of github.com:Start9…
dr-bonez Mar 11, 2024
4d402b2
chore: Fix the issue that I made that made it impossible to start a s…
Blu-J Mar 11, 2024
c99d9d9
chore: Add in the properties to somewhere useful.
Blu-J Mar 11, 2024
750f35b
add `--include-private` to db dump rpc
dr-bonez Mar 11, 2024
1f47abf
Merge branch 'integration/new-container-runtime' of github.com:Start9…
dr-bonez Mar 11, 2024
ba325b1
feat: Move the store to private.
Blu-J Mar 12, 2024
b6fe0be
chore: Add in some more files for the testing of the sdk and the rust…
Blu-J Mar 13, 2024
a089d54
chore: Add some of the fixes to make the build work !!!
Blu-J Mar 13, 2024
e871822
chore: Fix the build for the start9labs/sdk was a new directory struc…
Blu-J Mar 14, 2024
45d50b1
chore: Update the types for the sdk
Blu-J Mar 14, 2024
a310c16
chore: Update the types hopefully
Blu-J Mar 14, 2024
e604c91
chore: UPdate to the make, getting rid of a circular dep
Blu-J Mar 15, 2024
1a396cf
reorganize package data and write dependencies rpc (#2571)
dr-bonez Mar 15, 2024
18a2040
chore: Fix the build
Blu-J Mar 15, 2024
9715873
chore: Add in the rest of the effects for now
Blu-J Mar 15, 2024
28fd2f0
More 036 Frontend changes (#2572)
MattDHill Mar 16, 2024
9732846
chore: Update the sdk to match the rust and vica verse
Blu-J Mar 18, 2024
a4cb270
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Mar 18, 2024
a02b531
update sdk
MattDHill Mar 18, 2024
8e2dc8b
chore: Fix the effects
Blu-J Mar 18, 2024
5f40fd6
chore: Remove the utils
Blu-J Mar 18, 2024
3c6c0b2
move mounts to daemons constructor
dr-bonez Mar 18, 2024
2ffa632
Merge branch 'integration/new-container-runtime' of github.com:Start9…
dr-bonez Mar 18, 2024
3a3df96
fix: Test
Blu-J Mar 18, 2024
962e3d8
more specific rust type
dr-bonez Mar 18, 2024
a0ce7f3
chore: Add in the thing to do the volumes correctly
Blu-J Mar 18, 2024
417befb
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Mar 18, 2024
c8be701
chore: Add in the mounts
Blu-J Mar 18, 2024
cc38dab
Rework PackageDataEntry for new strategy (#2573)
MattDHill Mar 19, 2024
3ac71e2
include sdk.Mounts
dr-bonez Mar 19, 2024
53108e8
Merge branch 'integration/new-container-runtime' of github.com:Start9…
dr-bonez Mar 19, 2024
590f6d4
chore: Update the types
Blu-J Mar 19, 2024
47b19e3
fix duplicate
dr-bonez Mar 19, 2024
9162697
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Mar 19, 2024
8d83f64
chore: Update the types for the mocks in the services
Blu-J Mar 19, 2024
57f548c
fix certificate chain
dr-bonez Mar 19, 2024
53d8261
chore: Update the types and get the container-runtime working
Blu-J Mar 20, 2024
41bc519
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Mar 20, 2024
ddd5e4c
blu-j paired changes
Dominion5254 Mar 20, 2024
c74bdc9
fix: util -> utils in the container-runtime
Blu-J Mar 20, 2024
4a27128
chore: Update the types for changes that Matt wanted with sdk + examples
Blu-J Mar 21, 2024
405b3be
complete get_container_ip effect handler
Dominion5254 Mar 21, 2024
ab836c6
remove unneeded imports
Dominion5254 Mar 21, 2024
66b0108
revamp manifest types
MattDHill Mar 21, 2024
a35baca
update rust types to match sdk changes
dr-bonez Mar 21, 2024
f5360cb
wip: Adding in properties and nested path
Blu-J Mar 23, 2024
7441de5
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Mar 23, 2024
b14646e
export tyeps from sdk
MattDHill Mar 24, 2024
c782bab
switch all FE to camelCase (#2576)
MattDHill Mar 24, 2024
fba1484
fix: Bringing in a building for the browser
Blu-J Mar 25, 2024
299d999
chore: Making sure that the values that we are returning are valid no…
Blu-J Mar 25, 2024
e148f14
wip: Properties
Blu-J Mar 25, 2024
2b3fddf
use correct serverconfig type
dr-bonez Mar 25, 2024
cf793f7
Merge branch 'integration/new-container-runtime' of github.com:Start9…
dr-bonez Mar 25, 2024
9cf720e
rename embassy to startos
dr-bonez Mar 26, 2024
4589d4b
update ts-rs to 8.1
dr-bonez Mar 26, 2024
f8441ab
chore: Add in the fix for the test integration to the actual sdk
Blu-J Mar 26, 2024
e25c50a
fix types to match
dr-bonez Mar 26, 2024
33e6be1
Merge branch 'integration/new-container-runtime' of github.com:Start9…
dr-bonez Mar 26, 2024
f9edff8
handle todos
dr-bonez Mar 26, 2024
22d8d08
update patch types for current dependencies
MattDHill Mar 27, 2024
bcc76dd
fix: The db dump on the private
Blu-J Mar 27, 2024
5698b83
Fix: Fix the issue where the restart after a service install and update,
Blu-J Mar 27, 2024
f770d50
export patchdb types
dr-bonez Mar 27, 2024
9cf62f0
Add some extra export action
Blu-J Mar 27, 2024
f41f5eb
export patchdb ts types from rust
dr-bonez Mar 27, 2024
65ca038
chore: Update and fix the things
Blu-J Mar 28, 2024
8ce6535
chore: Update the types for container runtime
Blu-J Mar 28, 2024
86d61d6
update types and format bindings
dr-bonez Mar 28, 2024
e05a95d
Merge branch 'integration/new-container-runtime' of github.com:Start9…
dr-bonez Mar 28, 2024
6e76bcb
fix updates rendering bug
MattDHill Mar 28, 2024
9f3902b
chore: Fix the last of the actions
Blu-J Mar 28, 2024
2395502
Merge branch 'integration/new-container-runtime' of github.com:Start9…
Blu-J Mar 28, 2024
92be4e7
build fixes
dr-bonez Mar 28, 2024
7c63d40
fix build
dr-bonez Mar 28, 2024
665eef6
fix unterminated quote
dr-bonez Mar 28, 2024
e7426ea
touch bindings before make touch
dr-bonez Mar 28, 2024
46412ac
add container runtime to compiled tar
dr-bonez Mar 29, 2024
94f1562
choose base image by arch instead of platform
dr-bonez Mar 29, 2024
61f68d9
install qemu
dr-bonez Mar 29, 2024
3bab767
install qemu as root
dr-bonez Mar 29, 2024
44e856e
fix make -t
dr-bonez Mar 29, 2024
bec63a9
remove extra sdk test line
dr-bonez Mar 29, 2024
1acdd67
chown volume mountpoints
dr-bonez Mar 29, 2024
2318593
fix cargo dep
dr-bonez Mar 29, 2024
b6992e3
yes
dr-bonez Mar 29, 2024
4d6dd44
allow downgrades
dr-bonez Mar 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 6 additions & 4 deletions .github/workflows/startos-iso.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
- dev
- unstable
- dev-unstable
- docker
- dev-docker
- dev-unstable-docker
runner:
type: choice
description: Runner
Expand Down Expand Up @@ -82,9 +79,12 @@ jobs:
with:
node-version: ${{ env.NODEJS_VERSION }}

- name: Set up QEMU
- name: Set up docker QEMU
uses: docker/setup-qemu-action@v2

- name: Set up system QEMU
run: sudo apt-get update && sudo apt-get install -y qemu-user-static

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand Down Expand Up @@ -172,6 +172,8 @@ jobs:
- name: Prevent rebuild of compiled artifacts
run: |
mkdir -p web/dist/raw
touch core/startos/bindings
mkdir -p container-runtime/dist
PLATFORM=${{ matrix.platform }} make -t compiled-${{ env.ARCH }}.tar

- name: Run iso build
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ secrets.db
/dpkg-workdir
/compiled.tar
/compiled-*.tar
/firmware
/firmware
/tmp
90 changes: 60 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ BASENAME := $(shell ./basename.sh)
PLATFORM := $(shell if [ -f ./PLATFORM.txt ]; then cat ./PLATFORM.txt; else echo unknown; fi)
ARCH := $(shell if [ "$(PLATFORM)" = "raspberrypi" ]; then echo aarch64; else echo $(PLATFORM) | sed 's/-nonfree$$//g'; fi)
IMAGE_TYPE=$(shell if [ "$(PLATFORM)" = raspberrypi ]; then echo img; else echo iso; fi)
BINS := core/target/$(ARCH)-unknown-linux-gnu/release/startbox core/target/aarch64-unknown-linux-musl/release/container-init core/target/x86_64-unknown-linux-musl/release/container-init
BINS := core/target/$(ARCH)-unknown-linux-musl/release/startbox core/target/$(ARCH)-unknown-linux-musl/release/containerbox
WEB_UIS := web/dist/raw/ui web/dist/raw/setup-wizard web/dist/raw/diagnostic-ui web/dist/raw/install-wizard
FIRMWARE_ROMS := ./firmware/$(PLATFORM) $(shell jq --raw-output '.[] | select(.platform[] | contains("$(PLATFORM)")) | "./firmware/$(PLATFORM)/" + .id + ".rom.gz"' build/lib/firmware.json)
BUILD_SRC := $(shell git ls-files build) build/lib/depends build/lib/conflicts $(FIRMWARE_ROMS)
BUILD_SRC := $(shell git ls-files build) build/lib/depends build/lib/conflicts container-runtime/rootfs.$(ARCH).squashfs $(FIRMWARE_ROMS)
DEBIAN_SRC := $(shell git ls-files debian/)
IMAGE_RECIPE_SRC := $(shell git ls-files image-recipe/)
STARTD_SRC := core/startos/startd.service $(BUILD_SRC)
COMPAT_SRC := $(shell git ls-files system-images/compat/)
UTILS_SRC := $(shell git ls-files system-images/utils/)
BINFMT_SRC := $(shell git ls-files system-images/binfmt/)
CORE_SRC := $(shell git ls-files core) $(shell git ls-files --recurse-submodules patch-db) web/dist/static web/patchdb-ui-seed.json $(GIT_HASH_FILE)
CORE_SRC := $(shell git ls-files -- core ':!:core/startos/bindings/*') $(shell git ls-files --recurse-submodules patch-db) web/dist/static web/patchdb-ui-seed.json $(GIT_HASH_FILE)
WEB_SHARED_SRC := $(shell git ls-files web/projects/shared) $(shell ls -p web/ | grep -v / | sed 's/^/web\//g') web/node_modules web/config.json patch-db/client/dist web/patchdb-ui-seed.json
WEB_UI_SRC := $(shell git ls-files web/projects/ui)
WEB_SETUP_WIZARD_SRC := $(shell git ls-files web/projects/setup-wizard)
Expand All @@ -25,8 +25,8 @@ WEB_INSTALL_WIZARD_SRC := $(shell git ls-files web/projects/install-wizard)
PATCH_DB_CLIENT_SRC := $(shell git ls-files --recurse-submodules patch-db/client)
GZIP_BIN := $(shell which pigz || which gzip)
TAR_BIN := $(shell which gtar || which tar)
COMPILED_TARGETS := $(BINS) system-images/compat/docker-images/$(ARCH).tar system-images/utils/docker-images/$(ARCH).tar system-images/binfmt/docker-images/$(ARCH).tar
ALL_TARGETS := $(STARTD_SRC) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) $(COMPILED_TARGETS) $(shell if [ "$(PLATFORM)" = "raspberrypi" ]; then echo cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep; fi) $(shell /bin/bash -c 'if [[ "${ENVIRONMENT}" =~ (^|-)unstable($$|-) ]]; then echo cargo-deps/$(ARCH)-unknown-linux-gnu/release/tokio-console; fi') $(PLATFORM_FILE)
COMPILED_TARGETS := $(BINS) system-images/compat/docker-images/$(ARCH).tar system-images/utils/docker-images/$(ARCH).tar system-images/binfmt/docker-images/$(ARCH).tar container-runtime/rootfs.$(ARCH).squashfs
ALL_TARGETS := $(STARTD_SRC) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE) $(COMPILED_TARGETS) $(shell if [ "$(PLATFORM)" = "raspberrypi" ]; then echo cargo-deps/aarch64-unknown-linux-musl/release/pi-beep; fi) $(shell /bin/bash -c 'if [[ "${ENVIRONMENT}" =~ (^|-)unstable($$|-) ]]; then echo cargo-deps/$(ARCH)-unknown-linux-musl/release/tokio-console; fi') $(PLATFORM_FILE) sdk/lib/test

ifeq ($(REMOTE),)
mkdir = mkdir -p $1
Expand All @@ -49,10 +49,13 @@ endif

.DELETE_ON_ERROR:

.PHONY: all metadata install clean format sdk snapshots uis ui reflash deb $(IMAGE_TYPE) squashfs sudo wormhole test
.PHONY: all metadata install clean format cli uis ui reflash deb $(IMAGE_TYPE) squashfs sudo wormhole test

all: $(ALL_TARGETS)

touch:
touch $(ALL_TARGETS)

metadata: $(VERSION_FILE) $(PLATFORM_FILE) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE)

sudo:
Expand All @@ -74,6 +77,11 @@ clean:
rm -rf image-recipe/deb
rm -rf results
rm -rf build/lib/firmware
rm -rf container-runtime/dist
rm -rf container-runtime/node_modules
rm -f container-runtime/*.squashfs
rm -rf sdk/dist
rm -rf sdk/node_modules
rm -f ENVIRONMENT.txt
rm -f PLATFORM.txt
rm -f GIT_HASH.txt
Expand All @@ -82,11 +90,13 @@ clean:
format:
cd core && cargo +nightly fmt

test: $(CORE_SRC) $(ENVIRONMENT_FILE)
cd core && cargo build && cargo test
test: $(CORE_SRC) $(ENVIRONMENT_FILE)
(cd core && cargo build && cargo test)
npm --prefix sdk exec -- prettier -w ./core/startos/bindings/*.ts
(cd sdk && make test)

sdk:
cd core && ./install-sdk.sh
cli:
cd core && ./install-cli.sh

deb: results/$(BASENAME).deb

Expand All @@ -104,34 +114,30 @@ results/$(BASENAME).$(IMAGE_TYPE) results/$(BASENAME).squashfs: $(IMAGE_RECIPE_S
./image-recipe/run-local-build.sh "results/$(BASENAME).deb"

# For creating os images. DO NOT USE
install: $(ALL_TARGETS)
install: $(ALL_TARGETS)
$(call mkdir,$(DESTDIR)/usr/bin)
$(call cp,core/target/$(ARCH)-unknown-linux-gnu/release/startbox,$(DESTDIR)/usr/bin/startbox)
$(call cp,core/target/$(ARCH)-unknown-linux-musl/release/startbox,$(DESTDIR)/usr/bin/startbox)
$(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/startd)
$(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/start-cli)
$(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/start-sdk)
$(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/start-deno)
$(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/avahi-alias)
$(call ln,/usr/bin/startbox,$(DESTDIR)/usr/bin/embassy-cli)
if [ "$(PLATFORM)" = "raspberrypi" ]; then $(call cp,cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep,$(DESTDIR)/usr/bin/pi-beep); fi
if /bin/bash -c '[[ "${ENVIRONMENT}" =~ (^|-)unstable($$|-) ]]'; then $(call cp,cargo-deps/$(ARCH)-unknown-linux-gnu/release/tokio-console,$(DESTDIR)/usr/bin/tokio-console); fi
if [ "$(PLATFORM)" = "raspberrypi" ]; then $(call cp,cargo-deps/aarch64-unknown-linux-musl/release/pi-beep,$(DESTDIR)/usr/bin/pi-beep); fi
if /bin/bash -c '[[ "${ENVIRONMENT}" =~ (^|-)unstable($$|-) ]]'; then $(call cp,cargo-deps/$(ARCH)-unknown-linux-musl/release/tokio-console,$(DESTDIR)/usr/bin/tokio-console); fi

$(call mkdir,$(DESTDIR)/lib/systemd/system)
$(call cp,core/startos/startd.service,$(DESTDIR)/lib/systemd/system/startd.service)

$(call mkdir,$(DESTDIR)/usr/lib)
$(call rm,$(DESTDIR)/usr/lib/startos)
$(call cp,build/lib,$(DESTDIR)/usr/lib/startos)
$(call mkdir,$(DESTDIR)/usr/lib/startos/container-runtime)
$(call cp,container-runtime/rootfs.$(ARCH).squashfs,$(DESTDIR)/usr/lib/startos/container-runtime/rootfs.squashfs)

$(call cp,PLATFORM.txt,$(DESTDIR)/usr/lib/startos/PLATFORM.txt)
$(call cp,ENVIRONMENT.txt,$(DESTDIR)/usr/lib/startos/ENVIRONMENT.txt)
$(call cp,GIT_HASH.txt,$(DESTDIR)/usr/lib/startos/GIT_HASH.txt)
$(call cp,VERSION.txt,$(DESTDIR)/usr/lib/startos/VERSION.txt)

$(call mkdir,$(DESTDIR)/usr/lib/startos/container)
$(call cp,core/target/aarch64-unknown-linux-musl/release/container-init,$(DESTDIR)/usr/lib/startos/container/container-init.arm64)
$(call cp,core/target/x86_64-unknown-linux-musl/release/container-init,$(DESTDIR)/usr/lib/startos/container/container-init.amd64)

$(call mkdir,$(DESTDIR)/usr/lib/startos/system-images)
$(call cp,system-images/compat/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/startos/system-images/compat.tar)
$(call cp,system-images/utils/docker-images/$(ARCH).tar,$(DESTDIR)/usr/lib/startos/system-images/utils.tar)
Expand All @@ -148,8 +154,9 @@ update-overlay: $(ALL_TARGETS)
$(MAKE) install REMOTE=$(REMOTE) SSHPASS=$(SSHPASS) PLATFORM=$(PLATFORM)
$(call ssh,"sudo systemctl start startd")

wormhole: core/target/$(ARCH)-unknown-linux-gnu/release/startbox
@wormhole send core/target/$(ARCH)-unknown-linux-gnu/release/startbox 2>&1 | awk -Winteractive '/wormhole receive/ { printf "sudo /usr/lib/startos/scripts/chroot-and-upgrade \"cd /usr/bin && rm startbox && wormhole receive --accept-file %s && chmod +x startbox\"\n", $$3 }'
wormhole: core/target/$(ARCH)-unknown-linux-musl/release/startbox
@echo "Paste the following command into the shell of your start-os server:"
@wormhole send core/target/$(ARCH)-unknown-linux-musl/release/startbox 2>&1 | awk -Winteractive '/wormhole receive/ { printf "sudo /usr/lib/startos/scripts/chroot-and-upgrade \"cd /usr/bin && rm startbox && wormhole receive --accept-file %s && chmod +x startbox\"\n", $$3 }'

update: $(ALL_TARGETS)
@if [ -z "$(REMOTE)" ]; then >&2 echo "Must specify REMOTE" && false; fi
Expand All @@ -166,13 +173,39 @@ emulate-reflash: $(ALL_TARGETS)
upload-ota: results/$(BASENAME).squashfs
TARGET=$(TARGET) KEY=$(KEY) ./upload-ota.sh

container-runtime/alpine.$(ARCH).squashfs:
ARCH=$(ARCH) ./container-runtime/download-base-image.sh

container-runtime/node_modules: container-runtime/package.json container-runtime/package-lock.json sdk/dist
npm --prefix container-runtime ci
touch container-runtime/node_modules

core/startos/bindings: $(shell git ls-files -- core ':!:core/startos/bindings/*') $(ENVIRONMENT_FILE)
rm -rf core/startos/bindings
(cd core/ && cargo test --features=test)
npm --prefix sdk exec -- prettier -w ./core/startos/bindings/*.ts

sdk/dist: $(shell git ls-files sdk) core/startos/bindings
(cd sdk && make bundle)

# TODO: make container-runtime its own makefile?
container-runtime/dist/index.js: container-runtime/node_modules $(shell git ls-files container-runtime/src) container-runtime/package.json container-runtime/tsconfig.json
npm --prefix container-runtime run build

container-runtime/dist/node_modules container-runtime/dist/package.json container-runtime/dist/package-lock.json: container-runtime/package.json container-runtime/package-lock.json sdk/dist container-runtime/install-dist-deps.sh
./container-runtime/install-dist-deps.sh
touch container-runtime/dist/node_modules

container-runtime/rootfs.$(ARCH).squashfs: container-runtime/alpine.$(ARCH).squashfs container-runtime/containerRuntime.rc container-runtime/update-image.sh container-runtime/dist/index.js container-runtime/dist/node_modules core/target/$(ARCH)-unknown-linux-musl/release/containerbox | sudo
ARCH=$(ARCH) ./container-runtime/update-image.sh

build/lib/depends build/lib/conflicts: build/dpkg-deps/*
build/dpkg-deps/generate.sh

$(FIRMWARE_ROMS): build/lib/firmware.json download-firmware.sh $(PLATFORM_FILE)
./download-firmware.sh $(PLATFORM)

system-images/compat/docker-images/$(ARCH).tar: $(COMPAT_SRC) core/Cargo.lock
system-images/compat/docker-images/$(ARCH).tar: $(COMPAT_SRC)
cd system-images/compat && make docker-images/$(ARCH).tar && touch docker-images/$(ARCH).tar

system-images/utils/docker-images/$(ARCH).tar: $(UTILS_SRC)
Expand All @@ -181,15 +214,12 @@ system-images/utils/docker-images/$(ARCH).tar: $(UTILS_SRC)
system-images/binfmt/docker-images/$(ARCH).tar: $(BINFMT_SRC)
cd system-images/binfmt && make docker-images/$(ARCH).tar && touch docker-images/$(ARCH).tar

snapshots: core/snapshot-creator/Cargo.toml
cd core/ && ARCH=aarch64 ./build-v8-snapshot.sh
cd core/ && ARCH=x86_64 ./build-v8-snapshot.sh

$(BINS): $(CORE_SRC) $(ENVIRONMENT_FILE)
cd core && ARCH=$(ARCH) ./build-prod.sh
touch $(BINS)

web/node_modules: web/package.json
web/node_modules: web/package.json sdk/dist
(cd sdk && make bundle)
npm --prefix web ci

web/dist/raw/ui: $(WEB_UI_SRC) $(WEB_SHARED_SRC)
Expand Down Expand Up @@ -231,8 +261,8 @@ uis: $(WEB_UIS)
# this is a convenience step to build the UI
ui: web/dist/raw/ui

cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep:
cargo-deps/aarch64-unknown-linux-musl/release/pi-beep:
ARCH=aarch64 ./build-cargo-dep.sh pi-beep

cargo-deps/$(ARCH)-unknown-linux-gnu/release/tokio-console:
cargo-deps/$(ARCH)-unknown-linux-musl/release/tokio-console:
ARCH=$(ARCH) ./build-cargo-dep.sh tokio-console
4 changes: 2 additions & 2 deletions build-cargo-dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ if [ -z "$ARCH" ]; then
fi

mkdir -p cargo-deps
alias 'rust-arm64-builder'='docker run $USE_TTY --rm -v "$HOME/.cargo/registry":/usr/local/cargo/registry -v "$(pwd)"/cargo-deps:/home/rust/src -P start9/rust-arm-cross:aarch64'
alias 'rust-musl-builder'='docker run $USE_TTY --rm -e "RUSTFLAGS=$RUSTFLAGS" -v "$HOME/.cargo/registry":/root/.cargo/registry -v "$(pwd)"/cargo-deps:/home/rust/src -w /home/rust/src -P messense/rust-musl-cross:$ARCH-musl'

rust-arm64-builder cargo install "$1" --target-dir /home/rust/src --target=$ARCH-unknown-linux-gnu
rust-musl-builder cargo install "$1" --target-dir /home/rust/src --target=$ARCH-unknown-linux-musl
sudo chown -R $USER cargo-deps
sudo chown -R $USER ~/.cargo
4 changes: 2 additions & 2 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
lib/depends
lib/conflicts
/lib/depends
/lib/conflicts
2 changes: 1 addition & 1 deletion build/dpkg-deps/depends
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ httpdirfs
iotop
iw
jq
libavahi-client3
libyajl2
linux-cpupower
lm-sensors
lshw
lvm2
lxc
magic-wormhole
man-db
ncdu
Expand Down
5 changes: 0 additions & 5 deletions build/dpkg-deps/docker.depends

This file was deleted.

8 changes: 4 additions & 4 deletions build/lib/firmware.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[
{
"id": "pureboot-librem_mini_v2-basic_usb_autoboot_blob_jail-Release-28.3",
"id": "pureboot-librem_mini_v2-basic_usb_autoboot_blob_jail-Release-29",
"platform": ["x86_64"],
"system-product-name": "librem_mini_v2",
"bios-version": {
"semver-prefix": "PureBoot-Release-",
"semver-range": "<28.3"
"semver-range": "<29"
},
"url": "https://source.puri.sm/firmware/releases/-/raw/master/librem_mini_v2/custom/pureboot-librem_mini_v2-basic_usb_autoboot_blob_jail-Release-28.3.rom.gz",
"shasum": "5019bcf53f7493c7aa74f8ef680d18b5fc26ec156c705a841433aaa2fdef8f35"
"url": "https://source.puri.sm/firmware/releases/-/raw/master/librem_mini_v2/custom/pureboot-librem_mini_v2-basic_usb_autoboot_blob_jail-Release-29.rom.gz",
"shasum": "96ec04f21b1cfe8e28d9a2418f1ff533efe21f9bbbbf16e162f7c814761b068b"
}
]
8 changes: 8 additions & 0 deletions container-runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
dist/
bundle.js
startInit.js
service/
service.js
*.squashfs
/tmp
4 changes: 4 additions & 0 deletions container-runtime/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM node:18-alpine

ADD ./startInit.js /usr/local/lib/startInit.js
ADD ./entrypoint.sh /usr/local/bin/entrypoint.sh
59 changes: 59 additions & 0 deletions container-runtime/RPCSpec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Container RPC SERVER Specification

## Methods

### init
initialize runtime (mount `/proc`, `/sys`, `/dev`, and `/run` to each image in `/media/images`)

called after os has mounted js and images to the container
#### args
`[]`
#### response
`null`

### exit
shutdown runtime
#### args
`[]`
#### response
`null`

### start
run main method if not already running
#### args
`[]`
#### response
`null`

### stop
stop main method by sending SIGTERM to child processes, and SIGKILL after timeout
#### args
`{ timeout: millis }`
#### response
`null`

### execute
run a specific package procedure
#### args
```ts
{
procedure: JsonPath,
input: any,
timeout: millis,
}
```
#### response
`any`

### sandbox
run a specific package procedure in sandbox mode
#### args
```ts
{
procedure: JsonPath,
input: any,
timeout: millis,
}
```
#### response
`any`
10 changes: 10 additions & 0 deletions container-runtime/containerRuntime.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/sbin/openrc-run

name=containerRuntime
#cfgfile="/etc/containerRuntime/containerRuntime.conf"
command="/usr/bin/node"
command_args="--experimental-detect-module --unhandled-rejections=warn /usr/lib/startos/init/index.js"
pidfile="/run/containerRuntime.pid"
command_background="yes"
output_log="/var/log/containerRuntime.log"
error_log="/var/log/containerRuntime.err"
Loading
Loading