Skip to content

Commit

Permalink
build: Drop need for internal SSH key, prepare README for merge, poin…
Browse files Browse the repository at this point in the history
…t to latest release instead of current branch for downloads
  • Loading branch information
pojntfx committed Jun 28, 2024
1 parent 7dceaa6 commit 2a84ce9
Show file tree
Hide file tree
Showing 6 changed files with 303 additions and 128 deletions.
45 changes: 20 additions & 25 deletions .github/workflows/hydrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- id: test
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: GOFLAGS="-short" ./Hydrunfile test
dst: out/nonexistent
runner: depot-ubuntu-22.04-32
Expand All @@ -27,70 +27,70 @@ jobs:
- id: go.drafter-nat
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-nat
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-forwarder
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-forwarder
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-agent
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-agent
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-liveness
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-liveness
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-snapshotter
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-snapshotter
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-packager
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-packager
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-runner
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-runner
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-registry
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-registry
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-peer
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-peer
dst: out/*
runner: depot-ubuntu-22.04-32
- id: go.drafter-terminator
src: .
os: golang:bookworm
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache:/root/.cache/go-build'
flags: -e '-v /tmp/ccache:/root/.cache/go-build'
cmd: ./Hydrunfile go drafter-terminator
dst: out/*
runner: depot-ubuntu-22.04-32
Expand All @@ -99,14 +99,14 @@ jobs:
- id: os.drafter-x86_64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build -v /tmp/ccache/buildroot:/root/.buildroot-ccache'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build -v /tmp/ccache/buildroot:/root/.buildroot-ccache'
cmd: ./Hydrunfile os drafteros-firecracker-x86_64_defconfig drafteros-x86_64.tar.zst
dst: out/drafteros-x86_64.tar.zst
runner: depot-ubuntu-22.04-32
- id: os.drafter-aarch64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build -v /tmp/ccache/buildroot:/root/.buildroot-ccache'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build -v /tmp/ccache/buildroot:/root/.buildroot-ccache'
cmd: ./Hydrunfile os drafteros-firecracker-aarch64_defconfig drafteros-aarch64.tar.zst
dst: out/drafteros-aarch64.tar.zst
runner: depot-ubuntu-22.04-32
Expand All @@ -115,42 +115,42 @@ jobs:
- id: oci.valkey-x86_64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build'
cmd: ./Hydrunfile oci docker://valkey/valkey:latest amd64 oci-valkey-x86_64.tar.zst
dst: out/oci-valkey-x86_64.tar.zst
runner: depot-ubuntu-22.04-32
- id: oci.valkey-aarch64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build'
cmd: ./Hydrunfile oci docker://valkey/valkey:latest arm64 oci-valkey-aarch64.tar.zst
dst: out/oci-valkey-aarch64.tar.zst
runner: depot-ubuntu-22.04-32
- id: oci.postgres-x86_64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build'
cmd: ./Hydrunfile oci docker://postgres:latest amd64 oci-postgres-x86_64.tar.zst
dst: out/oci-postgres-x86_64.tar.zst
runner: depot-ubuntu-22.04-32
- id: oci.postgres-aarch64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build'
cmd: ./Hydrunfile oci docker://postgres:latest arm64 oci-postgres-aarch64.tar.zst
dst: out/oci-postgres-aarch64.tar.zst
runner: depot-ubuntu-22.04-32
- id: oci.ollama-x86_64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build'
cmd: ./Hydrunfile oci docker://ollama/ollama:latest amd64 oci-ollama-x86_64.tar.zst
dst: out/oci-ollama-x86_64.tar.zst
runner: depot-ubuntu-22.04-32
- id: oci.ollama-aarch64
src: .
os: fedora:40
flags: -e '-v /tmp/ssh-key:/tmp/ssh-key -v /tmp/ccache/go:/root/.cache/go-build'
flags: -e '-v /tmp/ccache/go:/root/.cache/go-build'
cmd: ./Hydrunfile oci docker://ollama/ollama:latest arm64 oci-ollama-aarch64.tar.zst
dst: out/oci-ollama-aarch64.tar.zst
runner: depot-ubuntu-22.04-32
Expand All @@ -172,11 +172,6 @@ jobs:
run: |
curl -L -o /tmp/hydrun "https://github.com/pojntfx/hydrun/releases/latest/download/hydrun.linux-$(uname -m)"
sudo install /tmp/hydrun /usr/local/bin
- name: Setup SSH key
working-directory: .
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: echo "${SSH_KEY}" | base64 -d >'/tmp/ssh-key'
- name: Build with hydrun
working-directory: ${{ matrix.target.src }}
run: hydrun -o ${{ matrix.target.os }} ${{ matrix.target.flags }} "${{ matrix.target.cmd }}"
Expand Down Expand Up @@ -211,7 +206,7 @@ jobs:
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Publish pre-release to GitHub releases
if: ${{ github.ref == 'refs/heads/replace-r3map-with-silo' }} # TODO: Set to `master` instead of `replace-r3map-with-silo` before this branch is merged
if: ${{ github.ref == 'refs/heads/master' }}
uses: softprops/action-gh-release@v2
with:
tag_name: release-${{ steps.extract_branch.outputs.branch }}
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[![License: AGPL 3.0](https://img.shields.io/github/license/loopholelabs/drafter)](https://www.gnu.org/licenses/agpl-3.0.en.html)
[![Discord](https://dcbadge.vercel.app/api/server/JYmFhtdPeu?style=flat)](https://loopholelabs.io/discord)
[![Tests](https://github.com/loopholelabs/drafter/actions/workflows/hydrun.yaml/badge.svg)](https://github.com/loopholelabs/drafter/actions/workflows/hydrun.yaml)
[![hydrun CI](https://github.com/loopholelabs/drafter/actions/workflows/hydrun.yaml/badge.svg)](https://github.com/loopholelabs/drafter/actions/workflows/hydrun.yaml)
![Go Version](https://img.shields.io/badge/go%20version-%3E=1.21-61CFDD.svg)
[![Go Reference](https://pkg.go.dev/badge/github.com/loopholelabs/drafter.svg)](https://pkg.go.dev/github.com/loopholelabs/drafter)

Expand Down Expand Up @@ -37,11 +37,9 @@ It enables you to ...

Drafter is available as static binaries on [GitHub releases](https://github.com/loopholelabs/drafter/releases). On Linux, you can install them like so:

<!-- TODO: Use the latest release URL here before this branch is merged -->

```shell
for BINARY in drafter-nat drafter-forwarder drafter-snapshotter drafter-packager drafter-runner drafter-registry drafter-peer drafter-terminator; do
curl -L -o "/tmp/${BINARY}" "https://github.com/loopholelabs/drafter/releases/download/release-replace-r3map-with-silo/${BINARY}.linux-$(uname -m)"
curl -L -o "/tmp/${BINARY}" "https://github.com/loopholelabs/drafter/releases/download/master/${BINARY}.linux-$(uname -m)"
sudo install "/tmp/${BINARY}" /usr/local/bin
done
```
Expand Down Expand Up @@ -91,12 +89,10 @@ In this tutorial, we'll use Drafter to run the key-value store [Valkey](https://

To download the pre-built blueprints for your architecture, execute the following commands:

<!-- TODO: Use the latest release URL here before this branch is merged -->

```shell
$ mkdir -p out
$ curl -Lo out/drafteros.tar.zst "https://github.com/loopholelabs/drafter/releases/download/release-replace-r3map-with-silo/drafteros-$(uname -m).tar.zst"
$ curl -Lo out/oci-valkey.tar.zst "https://github.com/loopholelabs/drafter/releases/download/release-replace-r3map-with-silo/oci-valkey-$(uname -m).tar.zst"
$ curl -Lo out/drafteros.tar.zst "https://github.com/loopholelabs/drafter/releases/download/master/drafteros-$(uname -m).tar.zst"
$ curl -Lo out/oci-valkey.tar.zst "https://github.com/loopholelabs/drafter/releases/download/master/oci-valkey-$(uname -m).tar.zst"
```

Next, use `drafter-packager` to extract the blueprints:
Expand Down
Loading

0 comments on commit 2a84ce9

Please sign in to comment.