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

Integrate Github Actions with self-hosted runner for ARM64 #2010

Closed
steve-chavez opened this issue Nov 4, 2021 · 2 comments · Fixed by #2127
Closed

Integrate Github Actions with self-hosted runner for ARM64 #2010

steve-chavez opened this issue Nov 4, 2021 · 2 comments · Fixed by #2127
Labels
ci Related to CI setup

Comments

@steve-chavez
Copy link
Member

Problem

Currently I have to manually compile PostgREST for ARM64 on an AWS Ubuntu instance - this has gotten too distracting and tedious.

And the same would have to be done for Docker #1117 (comment).

Proposal

Use Github Actions self-hosted runners to automate building on ARM64.

There's a list of examples in jonico/awesome-runners from where https://github.com/machulav/ec2-github-runner looks exactly what we need.

@steve-chavez steve-chavez added the ci Related to CI setup label Nov 4, 2021
@steve-chavez
Copy link
Member Author

I was using a custom build for cabal, but looks that nowadays they do offer a binary for aarch64(from https://www.haskell.org/cabal/download.html)

@laurenceisla
Copy link
Member

Adapting the commands I used to upload to my repository (latest and v9.0.0 were already in there), the manual process to add the arm64 architecture to the docker repo would be:

Create the dockerfile.

# Dockerfile

FROM arm64v8/ubuntu:focal AS postgrest-arm64

RUN apt-get update -y
RUN apt install libpq-dev zlib1g-dev jq gcc libnuma-dev -y

COPY postgrest /usr/bin/postgrest

EXPOSE 3000

USER 1000

CMD postgrest

Execute the commands.

# Supposing the postgrest arm64 binary and Dockerfile exist in ~/postgrest-bin

cd ~/postgrest-bin

# Build and add to manifest

sudo docker build -t postgrest/postgrest:latest-arm64 .
sudo docker push postgrest/postgrest:latest-arm64
sudo docker manifest create \
postgrest/postgrest:latest \
--amend postgrest/postgrest:latest \
--amend postgrest/postgrest:latest-arm64
sudo docker manifest push postgrest/postgrest:latest

sudo docker build -t postgrest/postgrest:v9.0.0-arm64 .
sudo docker push postgrest/postgrest:v9.0.0-arm64
sudo docker manifest create \
postgrest/postgrest:v9.0.0 \
--amend postgrest/postgrest:v9.0.0 \
--amend postgrest/postgrest:v9.0.0-arm64
sudo docker manifest push postgrest/postgrest:v9.0.0

Maybe using docker buildx build ... is better, but couldn't make it work.

Then delete the v9.0.0-arm64 and latest-arm64 tags from the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Related to CI setup
Development

Successfully merging a pull request may close this issue.

2 participants