-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Justin Alvarez <[email protected]>
- Loading branch information
Showing
8 changed files
with
83 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "finch-core"] | ||
path = deps/finch-core | ||
url = https://github.com/runfinch/finch-core.git | ||
url = https://github.com/pendo324/finch-core.git |
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 |
---|---|---|
|
@@ -30,6 +30,9 @@ GITCOMMIT ?= $(shell git rev-parse HEAD)$(shell test -z "$(git status --porcelai | |
LDFLAGS = "-w -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.GitCommit=$(GITCOMMIT)" | ||
MIN_MACOS_VERSION ?= 11.0 | ||
|
||
FINCH_DAEMON_LOCATION_ROOT ?= $(FINCH_OS_IMAGE_LOCATION_ROOT)/finch-daemon | ||
FINCH_DAEMON_LOCATION ?= $(FINCH_DAEMON_LOCATION_ROOT)/finch-daemon | ||
|
||
GOOS ?= $(shell $(GO) env GOOS) | ||
ifeq ($(GOOS),windows) | ||
BINARYNAME := $(addsuffix .exe, $(BINARYNAME)) | ||
|
@@ -61,7 +64,7 @@ endif | |
|
||
FINCH_CORE_DIR := $(CURDIR)/deps/finch-core | ||
|
||
remote-all: arch-test finch install.finch-core-dependencies finch.yaml networks.yaml config.yaml | ||
remote-all: arch-test finch install.finch-core-dependencies finch.yaml networks.yaml config.yaml $(OUTDIR)/finch-daemon/[email protected] | ||
|
||
ifeq ($(BUILD_OS), Windows_NT) | ||
include Makefile.windows | ||
|
@@ -146,6 +149,9 @@ finch-all: | |
.PHONY: release | ||
release: check-licenses all download-licenses | ||
|
||
$(OUTDIR)/finch-daemon/[email protected]: | ||
cp [email protected] $(OUTDIR)/finch-daemon/[email protected] | ||
|
||
.PHONY: coverage | ||
coverage: | ||
go test $(shell go list ./... | grep -v e2e | grep -v benchmark | grep -v mocks) -coverprofile=test-coverage.out | ||
|
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
Submodule finch-core
updated
12 files
+4 −4 | .github/workflows/cdk-e2e.yaml | |
+4 −4 | .github/workflows/ci.yaml | |
+9 −9 | .github/workflows/release.yaml | |
+1 −1 | .github/workflows/rootfs.yaml | |
+7 −2 | .github/workflows/submodulesync.yaml | |
+1 −1 | .github/workflows/update-dependencies.yaml | |
+3 −0 | .gitmodules | |
+10 −1 | Makefile | |
+4 −4 | deps/lima-bundles.conf | |
+4 −4 | e2e/go.mod | |
+10 −10 | e2e/go.sum | |
+1 −0 | src/finch-daemon |
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 |
---|---|---|
|
@@ -85,7 +85,26 @@ provision: | |
printf '[Unit]\nDescription=Delete hanging data on boot\nDefaultDependencies=no\nBefore=basic.target\n\n[Service]\nType=oneshot\nExecStart=/bin/bash -c "sudo rm -rf /var/lib/cni/networks/bridge/**; sudo rm -rf /var/lib/cni/results/bridge-finch-*"\n\n[Install]\nWantedBy=basic.target\n' | sudo tee /usr/local/lib/systemd/system/finch-cleanup-on-boot.service | ||
sudo systemctl enable --now finch-cleanup-on-boot.service | ||
# Set a default ulimit for number of files in containerd | ||
sudo mkdir -p /usr/local/lib/systemd/system/containerd.service.d/ | ||
printf '[Service]\nLimitNOFILE=1048576\n' | sudo tee /usr/local/lib/systemd/system/containerd.service.d/finch.conf | ||
sudo systemctl daemon-reload | ||
sudo systemctl restart containerd.service | ||
# wait for sshfs mounts to be added before starting finch-daemon | ||
echo "waiting for <finch_daemon_root> ..." | ||
until [ -f <finch_daemon_location> ] | ||
do | ||
sleep 1 | ||
done | ||
echo "mounts complete. Starting finch-daemon..." | ||
sudo cp <finch_daemon_location> /usr/local/bin/finch-daemon | ||
sudo cp <finch_daemon_root>/[email protected] /usr/local/lib/systemd/system/[email protected] | ||
|
||
sudo systemctl daemon-reload | ||
sudo systemctl enable --now finch@${UID} | ||
|
||
env: | ||
# Containerd namespace is used by the lima cidata script | ||
|
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,3 @@ | ||
mounts: | ||
- location: "<finch_daemon_root>" | ||
writable: true |
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 |
---|---|---|
|
@@ -7,6 +7,14 @@ provision: | |
- mode: boot | ||
script: | | ||
modprobe virtiofs | ||
# port this to common.yaml after windows socket forwarding is added | ||
- mode: user | ||
script: | | ||
sudo cp <finch_daemon_location> /usr/local/bin/finch-daemon | ||
sudo cp <finch_daemon_root>/[email protected] /usr/local/lib/systemd/system/[email protected] | ||
sudo systemctl daemon-reload | ||
sudo systemctl enable --now finch@${UID} | ||
mounts: | ||
- location: "~" | ||
mountPoint: null | ||
|
@@ -22,9 +30,9 @@ mounts: | |
cache: "fscache" | ||
- location: "/tmp/lima" | ||
writable: true | ||
- location: "/var/folders" | ||
- location: "/private" | ||
writable: true | ||
- location: "/private/var/folders" | ||
- location: "/var/folders" | ||
writable: true | ||
|
||
ssh: | ||
|
@@ -44,3 +52,7 @@ hostResolver: | |
hosts: | ||
host.finch.internal: host.lima.internal | ||
host.docker.internal: host.lima.internal | ||
|
||
portForwards: | ||
- guestSocket: "/run/finch.sock" | ||
hostSocket: "{{.Dir}}/sock/finch.sock" |
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 @@ | ||
[Unit] | ||
Description=Finch daemon %I | ||
Documentation=https://runfinch.com https://builderhub.corp.amazon.com/docs/docker.html#finch https://github.com/runfinch/finch-daemon | ||
After=network.target local-fs.target | ||
|
||
[Service] | ||
ExecStart=/usr/local/bin/finch-daemon --socket-owner %i | ||
ExecStartPost=-rm -rf /var/run/docker.sock | ||
ExecStartPost=ln -s /run/finch.sock /var/run/docker.sock | ||
|
||
Type=notify | ||
Delegate=yes | ||
Restart=always | ||
RestartSec=5 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |