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

WIP: Warpforge watch #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/warpforge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- 'master'
- 'main'
pull_request:
branches:
- '**'

jobs:
warpforge_job:
runs-on: ubuntu-latest
name: warpforge
steps:
- uses: actions/checkout@v3
- uses: TripleDogDare/warpforge-gh-action@test
with:
ref: master
3 changes: 3 additions & 0 deletions .warpforge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*
!.gitignore
!catalog
9 changes: 9 additions & 0 deletions .warpforge/catalog/go.dev/dl/go/_mirrors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"catalogmirrors.v1": {
"byWare": {
"tar:GC7V9jVyoYgM3Kk21ooqtDmitMobyCsUaRZ2RQXofGXH2eAp9Rdj1dQx7o9ryBQtz": [
"https://go.dev/dl/go1.18.7.linux-amd64.tar.gz"
]
}
}
}
9 changes: 9 additions & 0 deletions .warpforge/catalog/go.dev/dl/go/_module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"catalogmodule.v1": {
"name": "go.dev/dl/go",
"releases": {
"1.18.7": "zM5K3U8BMWpAL8di2KHdHmMAsBmh1PqLu9vP2Gn8zTZhabojAw8eHpj4hyALK15scwA5Eqj"
},
"metadata": {}
}
}
7 changes: 7 additions & 0 deletions .warpforge/catalog/go.dev/dl/go/_releases/1.18.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"releaseName": "1.18.7",
"items": {
"linux-amd64": "tar:GC7V9jVyoYgM3Kk21ooqtDmitMobyCsUaRZ2RQXofGXH2eAp9Rdj1dQx7o9ryBQtz"
},
"metadata": {}
}
9 changes: 9 additions & 0 deletions .warpforge/catalog/warpsys.org/bootstrap/gcc/_mirrors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"catalogmirrors.v1": {
"byWare": {
"tar:8ReBSHpZBrQs2sKs1b3sTZvUPXYQxXhecPnU8mtkvBBks6QNWN6K2RGiCyV419tLKM": [
"https://warpsys.s3.amazonaws.com/warpsys.org/warehouse/8ReBSHpZBrQs2sKs1b3sTZvUPXYQxXhecPnU8mtkvBBks6QNWN6K2RGiCyV419tLKM"
]
}
}
}
9 changes: 9 additions & 0 deletions .warpforge/catalog/warpsys.org/bootstrap/gcc/_module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"catalogmodule.v1": {
"name": "warpsys.org/bootstrap/gcc",
"releases": {
"v11.2.0": "zM5K3ZFHBVmv2u5RYqcfgGkWx8CnfqTLVKNWjrXhUFyB917E8n4VaF7o55XHAee9hR7dnrC"
},
"metadata": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"releaseName": "v11.2.0",
"items": {
"amd64": "tar:8ReBSHpZBrQs2sKs1b3sTZvUPXYQxXhecPnU8mtkvBBks6QNWN6K2RGiCyV419tLKM"
},
"metadata": {}
}
12 changes: 12 additions & 0 deletions .warpforge/catalog/warpsys.org/bootstrap/glibc/_mirrors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"catalogmirrors.v1": {
"byWare": {
"tar:CdoEWxD61NHcu1yayo2KjvFHAmwt2r3kxKYxudgKTAUyBqfmPQp4SnarHfKgYe1XN": [
"https://warpsys.s3.amazonaws.com/warpsys.org/warehouse/CdoEWxD61NHcu1yayo2KjvFHAmwt2r3kxKYxudgKTAUyBqfmPQp4SnarHfKgYe1XN"
],
"tar:9fttDVHncJnoU9gLHdRybpz9eSw12xau9AsJzZTNoQamxFNjX6s6HNTj7a8wmYjCvg": [
"https://warpsys.s3.amazonaws.com/warpsys.org/warehouse/9fttDVHncJnoU9gLHdRybpz9eSw12xau9AsJzZTNoQamxFNjX6s6HNTj7a8wmYjCvg"
]
}
}
}
9 changes: 9 additions & 0 deletions .warpforge/catalog/warpsys.org/bootstrap/glibc/_module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"catalogmodule.v1": {
"name": "warpsys.org/bootstrap/glibc",
"releases": {
"v2.35": "zM5K3YFZ37iJWqmiaJsUmrdDubN8gqiNYdJB1Ln5isJHFm3j6eFtqAgxnsDGxhR43cTC5o3"
},
"metadata": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"releaseName": "v2.35",
"items": {
"amd64": "tar:CdoEWxD61NHcu1yayo2KjvFHAmwt2r3kxKYxudgKTAUyBqfmPQp4SnarHfKgYe1XN",
"ld-amd64": "tar:9fttDVHncJnoU9gLHdRybpz9eSw12xau9AsJzZTNoQamxFNjX6s6HNTj7a8wmYjCvg"
},
"metadata": {}
}
9 changes: 9 additions & 0 deletions .warpforge/catalog/warpsys.org/busybox/_mirrors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"catalogmirrors.v1": {
"byWare": {
"tar:4z9DCTxoKkStqXQRwtf9nimpfQQ36dbndDsAPCQgECfbXt3edanUrsVKCjE9TkX2v9": [
"https://warpsys.s3.amazonaws.com/warehouse/4z9/DCT/4z9DCTxoKkStqXQRwtf9nimpfQQ36dbndDsAPCQgECfbXt3edanUrsVKCjE9TkX2v9"
]
}
}
}
9 changes: 9 additions & 0 deletions .warpforge/catalog/warpsys.org/busybox/_module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"catalogmodule.v1": {
"name": "warpsys.org/busybox",
"releases": {
"v1.35.0": "zM5K3Z62CY9X6QkccuptyiC3a1tC32Fh2n1ujF8KH5Fz1BvKqppWJZgQJxEgypvF3pqzhdE"
},
"metadata": {}
}
}
7 changes: 7 additions & 0 deletions .warpforge/catalog/warpsys.org/busybox/_releases/v1.35.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"releaseName": "v1.35.0",
"items": {
"amd64-static": "tar:4z9DCTxoKkStqXQRwtf9nimpfQQ36dbndDsAPCQgECfbXt3edanUrsVKCjE9TkX2v9"
},
"metadata": {}
}
39 changes: 39 additions & 0 deletions WIP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Add go version to catalog
`warpforge catalog add tar go.dev/dl/go:1.18.7:linux-amd64 https://go.dev/dl/go1.18.7.linux-amd64.tar.gz`

Stupid error info:
```
error: serialization error: unable to deserialize plot: Invalid byte while expecting start of value: 0x2f
```
plot.wf
```
00000000: 7b0a 0922 706c 6f74 2e76 3122 3a20 7b0a {.."plot.v1": {.
00000010: 0909 2269 6e70 7574 7322 3a20 7b0a 0909 .."inputs": {...
00000020: 0922 726f 6f74 6673 223a 2022 6361 7461 ."rootfs": "cata
00000030: 6c6f 673a 7761 7270 7379 732e 6f72 672f log:warpsys.org/
00000040: 6275 7379 626f 783a 7631 2e33 352e 303a busybox:v1.35.0:
```
crash
```
$ warpforge ferk --plot plot.wf --cmd /pkg/busybox/bin/sh
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xd87731]

goroutine 1 [running]:
main.cmdFerk(0xc0004f02c0)
/home/cjb/repos/warpforge/wf/cmd/warpforge/ferk.go:83 +0x4f1
github.com/warpfork/warpforge/cmd/warpforge/internal/util.CmdMiddlewareTracingSpan.func1(0xc0004f02c0)
/home/cjb/repos/warpforge/wf/cmd/warpforge/internal/util/middleware.go:42 +0x138
github.com/warpfork/warpforge/cmd/warpforge/internal/util.CmdMiddlewareTracingConfig.func1(0xc0004f02c0)
/home/cjb/repos/warpforge/wf/cmd/warpforge/internal/util/middleware.go:62 +0x203
github.com/warpfork/warpforge/cmd/warpforge/internal/util.CmdMiddlewareLogging.func1(0xc0004f02c0)
/home/cjb/repos/warpforge/wf/cmd/warpforge/internal/util/middleware.go:31 +0x182
github.com/urfave/cli/v2.(*Command).Run(0x17cdf40, 0xc0004f0040)
/home/cjb/gopath/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x5bb
github.com/urfave/cli/v2.(*App).RunContext(0xc0004e4340, {0x11856d8?, 0xc000036110}, {0xc0000321e0, 0x6, 0x6})
/home/cjb/gopath/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0xb48
github.com/urfave/cli/v2.(*App).Run(...)
/home/cjb/gopath/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
main.main()
/home/cjb/repos/warpforge/wf/cmd/warpforge/main.go:124 +0x67
```
5 changes: 5 additions & 0 deletions module.wf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"module.v1": {
"name": "github.com/warpfork/linkwarp"
}
}
118 changes: 118 additions & 0 deletions plot.wf
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"plot.v1": {
"inputs": {
"glibc": "catalog:warpsys.org/bootstrap/glibc:v2.35:amd64",
"ld": "catalog:warpsys.org/bootstrap/glibc:v2.35:ld-amd64",
"gcc": "catalog:warpsys.org/bootstrap/gcc:v11.2.0:amd64",
"rootfs": "catalog:warpsys.org/busybox:v1.35.0:amd64-static",
"golang": "catalog:go.dev/dl/go:1.18.7:linux-amd64",
"repo": "ingest:git:.:HEAD"
},
"steps": {
"pre-cache": {
"protoformula": {
"inputs": {
"/": "pipe::rootfs",
"/src": "pipe::repo",
"$PATH": "literal:/bin"
},
"action": {
"script": {
"interpreter": "/bin/sh",
"contents": [
"set -e",
"mkdir -p /tmp/mod",
"cp /src/go.mod /src/go.sum /tmp/mod"
],
"network": false
}
},
"outputs": {
"out": {
"from": "/tmp/mod",
"packtype": "tar"
}
}
}
},
"cache": {
"protoformula": {
"inputs": {
"/": "pipe::rootfs",
"/lib64": "pipe::ld",
"/pkg/glibc": "pipe::glibc",
"/pkg/gcc": "pipe::gcc",
"/pkg/go": "pipe::golang",
"/tmp/mod/": "pipe:pre-cache:out",
"$GOROOT": "literal:/pkg/go/go",
"$CGO_ENABLED": "literal:0",
"$LD_LIBRARY_PATH": "literal:/pkg/glibc/lib",
"$GO_LDFLAGS": "literal:-L /pkg/glibc/lib",
"$CPATH": "literal:/pkg/glibc/include:/pkg/glibc/include/x86_64-linux-gnu",
"$PATH": "literal:/bin:/pkg/go/go/bin:/pkg/gcc/bin",
"$GOMODCACHE": "literal:/tmp/cache"
},
"action": {
"script": {
"interpreter": "/bin/sh",
"contents": [
"set -e",
"echo caching dependencies",
"mkdir -p /tmp/cache",
"cd /tmp/mod",
"go mod download -modcacherw -x"
],
"network": true
}
},
"outputs": {
"out": {
"from": "/tmp/cache",
"packtype": "tar"
}
}
}
},
"build": {
"protoformula": {
"inputs": {
"/": "pipe::rootfs",
"/lib64": "pipe::ld",
"/pkg/glibc": "pipe::glibc",
"/pkg/gcc": "pipe::gcc",
"/pkg/go": "pipe::golang",
"/src/": "pipe::repo",
"/tmp/cache": "pipe:cache:out",
"$GOMODCACHE": "literal:/tmp/cache",
"$GOROOT": "literal:/pkg/go/go",
"$CGO_ENABLED": "literal:0",
"$LD_LIBRARY_PATH": "literal:/pkg/glibc/lib",
"$GO_LDFLAGS": "literal:-L /pkg/glibc/lib",
"$CPATH": "literal:/pkg/glibc/include:/pkg/glibc/include/x86_64-linux-gnu",
"$PATH": "literal:/bin:/pkg/go/go/bin:/pkg/gcc/bin"
},
"action": {
"script": {
"interpreter": "/bin/sh",
"contents": [
"set -e",
"cd /src",
"go build -v -tags netgo -o /output/linkwarp ./cmd/linkwarp/..."
],
"network": false
}
},
"outputs": {
"out": {
"from": "/output",
"packtype": "tar"
}
}
}
}
},
"outputs": {
"linux-amd64": "pipe:build:out"
}
}
}