-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from algorandfoundation/feat/algod-node-install
feat: Node Install, Start, Stop, Upgrade ENG-572
- Loading branch information
Showing
37 changed files
with
2,059 additions
and
27 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM golang:1.23-bookworm as BUILDER | ||
|
||
WORKDIR /app | ||
|
||
ADD . . | ||
|
||
RUN CGO_ENABLED=0 go build -cover -o ./bin/algorun *.go | ||
|
||
|
||
FROM fedora:39 as legacy | ||
|
||
ADD playbook.yaml /root/playbook.yaml | ||
COPY --from=BUILDER /app/bin/algorun /usr/bin/algorun | ||
RUN dnf install systemd ansible-core -y && \ | ||
mkdir -p /app/coverage/int/fedora/39 && \ | ||
echo GOCOVERDIR=/app/coverage/int/fedora/39 >> /etc/environment | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
CMD ["/usr/lib/systemd/systemd"] | ||
|
||
FROM fedora:40 as previous | ||
|
||
ADD playbook.yaml /root/playbook.yaml | ||
COPY --from=BUILDER /app/bin/algorun /usr/bin/algorun | ||
|
||
RUN dnf install systemd ansible-core -y && \ | ||
mkdir -p /app/coverage/int/fedora/40 && \ | ||
echo GOCOVERDIR=/app/coverage/int/fedora/40 >> /etc/environment | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
CMD ["/usr/lib/systemd/systemd"] | ||
|
||
FROM fedora:41 as latest | ||
|
||
ADD playbook.yaml /root/playbook.yaml | ||
COPY --from=BUILDER /app/bin/algorun /usr/bin/algorun | ||
|
||
RUN dnf install systemd ansible-core -y && \ | ||
mkdir -p /app/coverage/int/fedora/41 && \ | ||
echo GOCOVERDIR=/app/coverage/int/fedora/41 >> /etc/environment | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
CMD ["/usr/lib/systemd/systemd"] |
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,47 @@ | ||
FROM golang:1.23-bookworm as BUILDER | ||
|
||
WORKDIR /app | ||
|
||
ADD . . | ||
|
||
RUN CGO_ENABLED=0 go build -cover -o ./bin/algorun *.go | ||
|
||
FROM ubuntu:18.04 as bionic | ||
|
||
RUN apt-get update && apt-get install systemd software-properties-common -y && add-apt-repository --yes --update ppa:ansible/ansible | ||
|
||
ADD playbook.yaml /root/playbook.yaml | ||
COPY --from=BUILDER /app/bin/algorun /usr/bin/algorun | ||
RUN mkdir -p /app/coverage/int/ubuntu/18.04 && \ | ||
echo GOCOVERDIR=/app/coverage/int/ubuntu/18.04 >> /etc/environment && \ | ||
apt-get install ansible -y && \ | ||
chmod 0 /usr/bin/apt # Liam Neeson | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
CMD ["/bin/systemd"] | ||
|
||
FROM ubuntu:22.04 as jammy | ||
|
||
RUN apt-get update && apt-get install systemd software-properties-common -y && add-apt-repository --yes --update ppa:ansible/ansible | ||
|
||
ADD playbook.yaml /root/playbook.yaml | ||
COPY --from=BUILDER /app/bin/algorun /usr/bin/algorun | ||
RUN mkdir -p /app/coverage/int/ubuntu/22.04 && \ | ||
echo GOCOVERDIR=/app/coverage/int/ubuntu/22.04 >> /etc/environment && \ | ||
apt-get install ansible -y | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
CMD ["/usr/lib/systemd/systemd"] | ||
|
||
FROM ubuntu:24.04 as noble | ||
|
||
RUN apt-get update && apt-get install systemd software-properties-common -y && add-apt-repository --yes --update ppa:ansible/ansible | ||
|
||
ADD playbook.yaml /root/playbook.yaml | ||
COPY --from=BUILDER /app/bin/algorun /usr/bin/algorun | ||
RUN mkdir -p /app/coverage/int/ubuntu/24.04 && \ | ||
echo GOCOVERDIR=/app/coverage/int/ubuntu/24.04 >> /etc/environment && \ | ||
apt-get install ansible -y | ||
|
||
STOPSIGNAL SIGRTMIN+3 | ||
CMD ["/usr/lib/systemd/systemd"] |
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
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,56 @@ | ||
## This is a temporary flow, until we have our custom docker images that work with systemd for linux. | ||
## Once we have that, we can remove this and use docker containers in parallel, covering the various OS:es. | ||
|
||
name: Node Command OS-Matrix Test | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- "cmd/**" | ||
|
||
jobs: | ||
ubuntu: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22 | ||
- name: Run Ubuntu commands | ||
run: | | ||
go build . | ||
./algorun-tui node install | ||
systemctl status algorand.service | ||
export TOKEN=$(cat /var/lib/algorand/algod.admin.token) | ||
curl http://localhost:8080/v2/participation -H "X-Algo-API-Token: $TOKEN" | grep "null" | ||
./algorun-tui node stop | ||
./algorun-tui node upgrade | ||
./algorun-tui node stop | ||
./algorun-tui node uninstall | ||
macos: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
run: brew install go | ||
|
||
- name: Run MacOs commands | ||
run: | | ||
go build . | ||
./algorun-tui node install | ||
sudo launchctl print system/com.algorand.algod | ||
sleep 5 | ||
export TOKEN=$(cat ~/.algorand/algod.admin.token) | ||
curl http://localhost:8080/v2/participation -H "X-Algo-API-Token: $TOKEN" | grep "null" | ||
./algorun-tui node stop | ||
./algorun-tui node upgrade | ||
./algorun-tui node stop | ||
./algorun-tui node uninstall |
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
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
Oops, something went wrong.