• Stars
    star
    244
  • Rank 160,944 (Top 4 %)
  • Language
    Shell
  • Created about 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Risc-V journey thru containers and new projects

RISC-V bring-up tracker

The objective of this repository is to track the progress and pre-requisites to allow containers and Go applications on RISC-V.

The repo also hosts multiple files and images suited for the SiFive Unmatched and QEmu VMs.

There is a companion article available on https://medium.com/@carlosedp/docker-containers-on-RISC-V-architecture-5bc45725624b.

This page is also linked from http://bit.ly/riscvtracker.

If you like this project and others I've been contributing and would like to support me, please check-out my Patreon page!

Contents

RISC-V Unleashed SBC, Virtual Machines and pre-built binaries

To make the development easier, there are Qemu virtual machines based on Debian and Ubuntu with some developer tools already installed.

For the SiFive Unmatched, there is a prebuilt SDcard image at https://github.com/carlosedp/riscv-bringup/releases/download/v1.0/UbuntuHippo-RISC-V.img.gz

For QEmu, there are three distributions of RISC-V pre-packaged VM images:

The user is root and password riscv. For more information, check the readme.

A prebuilt Go 1.16 tarball can be downloaded here.

If required to build the complete boot stack composed of OpenSBI, U-Boot, Linux, checkout the guides for SiFive Unmatched, SiFive Unleashed and Qemu.

To run Go on the VM or board, install with:

# Start the VM
./run_debian.sh

# Download Golang tarball
wget https://github.com/carlosedp/riscv-bringup/releases/download/v1.0/go1.16.5-riscv64.tar.gz

# In the VM, unpack (in root dir for example)
tar vxf go1.16.5-riscv64.tar.gz -C /usr/local/

# Add to your PATH
export PATH="/usr/local/go/bin:$PATH"

# Addto bashrc
echo "export PATH=/usr/local/go/bin:$PATH" >> ~/.bashrc

To run Docker on your RISC-V Debian or Ubuntu environment, download a deb package and install with sudo apt install ./docker-v20.10.2-dev_riscv64.deb.

For other distros get the tarball here and unpack to your / dir. If the docker service doesn't start on install script, re-run systemctl start docker.

Docker-compose install instructions
# In Debian image
sudo apt-get install python3 python3-dev python3-pip

# For Fedora image
sudo dnf install python3-devel

sudo pip3 install docker-compose

To test it out after install, just run docker run -d -p 8080:8080 carlosedp/echo-riscv and then curl http://localhost:8080.

There are a couple of projects that build on RISC-V in my go-playground repo.

There is also a Podman package here in both .deb and .tar.gz. Check more info on build-podman-env.md to build the package from scratch.


Golang

Core Golang

Golang has been upstreamed as an experimental architecture in Go 1.14. There are no binaries published officially but the releases section has the tarball.

To build Go from source, check build-golang.md.

Go Std Libraries

External deps


Docker and pre-reqs

To build a complete Docker container stack, check the build-docker-env.md document.

Downloads for prebuilt packages are available on https://github.com/carlosedp/riscv-bringup/releases.

Libseccomp

https://github.com/seccomp/libseccomp

Builds fine from master branch. Will be released with riscv64 support on 2.5.

Runc

https://github.com/opencontainers/runc

  • Upstreamed / Works
  • Depends on CGO (to build nsenter)
  • Support buildmode=pie
  • Add riscv64 to libcontainer/system/syscall_linux_64.go
  • After upstreaming, update x/sys and x/net modules
  • libseccomp-dev
  • apparmor - ($ sudo aa-status -> apparmor module is not loaded.)
  • Add to CI

Crun

https://github.com/giuseppe/crun

No changes required, builds fine even without Kernel support for seccomp. Depends on libseccomp.

  • Upstreamed / Works
  • Rebuild with libseccomp
  • Add to CI

Containerd

https://github.com/containerd/containerd/

Docker

Docker cli

https://github.com/docker/cli

  • Upstreamed / Works (must be built from master)
  • Update x/sys and x/net modules in vendor. PR
  • Add riscv64 to manifest annotation. PR#2084
  • Add support for riscv64 on binfmt. PR#21
  • Docker for Mac - Add RISC-V binfmt. PR#4237
  • Add to CI

Docker daemon

https://github.com/moby/moby

  • Upstreamed / Works
  • PR moby/moby#40664 - Build scripts support for riscv64
  • PR moby/moby#39423 - Update dependencies
  • PR moby/moby#39327 - Remove CGO dependency
  • Update x/sys and x/net modules in vendor.
  • Update etcd-io/bbolt in vendor.
  • Update github.com/vishvananda/netns in vendor
  • Update github.com/vishvananda/netlink in vendor
  • Update github.com/ishidawataru/sctp in vendor
  • Update github.com/docker/libnetwork in vendor
  • Add to CI

Dependency lib PRs:

docker-init

https://github.com/krallin/tini

No changes required. Just build and copy tini-static to /usr/local/bin/docker-init

  • Upstreamed / Works

docker-proxy

No changes required. https://github.com/docker/libnetwork/cmd/proxy

  • Upstreamed / Works

Alternative is run dockerd as: sudo dockerd --userland-proxy=false

Issues


Podman - libpod

https://github.com/containers/libpod

Podman is a library and tool for running OCI-based containers in Pods

CNI Plugins

https://github.com/containernetworking/plugins

  • Builds and runs.

CNI Plugins Issues


Base Container Images

Docker Community "per-architecture" repository

Docker images for projects

OpenFaaS:

Prometheus:

Traefik:

Kubernetes:

Kubernetes images are multi-arch with manifests to arm, arm64, amd64, riscv64 and ppc64le. Some version mismatches due to Kubernetes hard-coded version check for CoreDNS and etcd.

Misc Images:


Kubernetes

https://github.com/kubernetes/kubernetes/

Building and deploying Kubernetes or K3s on RISC-V is detailed on a dedicated readme. There is a build script(build_images.sh) for custom images in kubernetes dir.

To Do:

  • Cross-platform builder image. Update kubernetes/build/build-image/cross adding riscv64 toolchain. Depends on Ubuntu crossbuild-essential-riscv64 be available.
  • Add riscv64 to ./build/pause Makefile. Depends on Go image with RISC-V support and cross-platform image.
Updating dependencies
# Update dependency
./hack/pin-dependency.sh github.com/mindprince/gonvml
# Update vendor dir
./hack/update-vendor.sh

# Build all main binaries
make KUBE_BUILD_PLATFORMS=linux/riscv64

# Build specifiv binaries
make WHAT=./cmd/${bin} KUBE_BUILD_PLATFORMS=linux/riscv64

# Binaries will be placed on _output/local/go/bin/linux_riscv64/

K3s

https://github.com/rancher/k3s/

K3s build depends on deploying external etcd database since sqlite embedded DB requires CGO. Another requirement is running k3s with Docker and crun as daemon (see Docker install) since runc, the default runtime for K3s requires CGO as well.

For more info, check file [kubernetes/Readme.md#K3s]

Bump:

Future
  • Embed database
  • Embed runtime

Additional projects / libraries

ETCD

https://github.com/etcd-io/etcd

Build with go build ., run with ETCD_UNSUPPORTED_ARCH=riscv64 ./etcd.

OpenFaaS

OpenFaaS is already upstreamed but still does not build images for RISC-V so I've built them and pushed to my DockerHub as links below. Here are the instructions to deploy OpenFaaS on your RISC-V host or VM.

The PRs do not add functionality to cross-build the images for RISC-V yet since the base images still don't support the architecture. Check the build_images.sh script to build the images manually.

Faas-cli

https://github.com/openfaas/faas-cli/

Faas-swarm

https://github.com/openfaas/faas-swarm

Nats-streaming-server

https://github.com/nats-io/nats-streaming-server

No changes required

Bbolt

https://github.com/etcd-io/bbolt

Pty

https://github.com/kr/pty

Prometheus

https://github.com/prometheus/prometheus

Builds successfully with make build.

Promu

https://github.com/prometheus/promu

AlertManager

https://github.com/prometheus/alertmanager

Already builds successfully with make build.

Traefik

https://github.com/containous/traefik

Building and running
rm -rf static/ autogen/
make generate-webui
go generate
mkdir dist
GOARCH=riscv64 GOOS=linux go build -o dist/traefik ./cmd/traefik
docker build -t carlosedp/traefik:v2.1-riscv64 .

See also a complete Traefik Dockerfile for cross-compiling.

To run an example stack with Docker Compose, create the file below and start it with docker-compose up -d. To test, you can open the address http://[IP]:8080/dashboard or curl http://localhost:8080/api/rawdata. Prometheus metrics are exposed on http://localhost:8080/metrics.

Create a docker-compose.yml

version: '3'

services:
  reverse-proxy:
    # The official v2.0 Traefik docker image
    image: carlosedp/traefik:v2.0-riscv64
    # Enables the web UI and tells Traefik to listen to docker
    command: --api --providers.docker --metrics.prometheus=true
    ports:
      # The HTTP port
      - "80:80"
      # The Web UI (enabled by --api)
      - "8080:8080"
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
  whoami:
    # A container that exposes an API to show its IP address
    image: carlosedp/whoami:riscv64
    labels:
      - "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"

Run with:

docker-compose up -d

SQlite

SQLite builds on RISC-V but requires replacing its building files.

Repository mirror: https://github.com/CanonicalLtd/sqlite

  • Upstreamed / Works
  • Update config.guess and config.sub to newer version. Posted to mailing list.

Go-Jsonnet

https://github.com/google/go-jsonnet

Github Hub tool

https://github.com/github/hub

Labstack Echo Framework

https://github.com/labstack/echo

Labstack Gommon

https://github.com/labstack/gommon

VNDR

https://github.com/LK4D4/vndr

Inlets

https://github.com/alexellis/inlets

Gin web framework

https://github.com/gin-gonic/gin

go-isatty

https://github.com/mattn/go-isatty

Dependency for Gin Framework

ginkgo

https://github.com/onsi/ginkgo

Dependency for building Kubernetes complete binaries

mquery

https://github.com/estesp/mquery

A simple utility and serverless-based backend for querying Docker v2 & OCI v1 container images and reporting on "manifest list"/OCI "index" multi-platform image support.


Community

References

More Repositories

1

cluster-monitoring

Cluster monitoring stack for clusters based on Prometheus Operator
Jsonnet
717
star
2

kubernetes-arm

Hybrid Kubernetes Cluster on ARM64 and AMD64 nodes
Shell
177
star
3

chiselv

A RISC-V Core (RV32I) written in Chisel HDL
Scala
86
star
4

PlatformIO-Renode-Demos

A collection of demos for PlatformIO framework and Renode simulation platform integration.
C
61
star
5

lbconfig-operator

A Kubernetes/Openshift Operator to configure external Load Balancers
Go
42
star
6

vimfiles

Vim configuration files
Vim Script
37
star
7

ddwrt-monitoring

DD-WRT Router Monitoring Stack
Shell
35
star
8

chisel-playground

Chisel HDL example applications
Scala
28
star
9

openshift-on-footloose

Running Openshift on Footloose, docker in docker
26
star
10

rpi-media-server

Docker compose files to create a Raspberry Pi Media Server
23
star
11

PSP-StacklessPython

Stackless Python 2.5 port for Sony PSP
Python
20
star
12

docker-arm_exporter

ARM CPU temperature exporter for Prometheus - Container builder
Dockerfile
19
star
13

QMTechBaseBoard

BaseBoard design for QMTech Kintex 7 FPGA
18
star
14

zio-scalajs-stack

Full-stack Scala ZIO + Scala.js application for test
Scala
13
star
15

zio-temporal-hello

Sample hello application using Scala 3 and zio-temporal
Scala
13
star
16

dcca-server-OTP

Erlang Diameter Credit Control (DCCA) OTP application
Erlang
12
star
17

mill-docker-nativeimage

A Scala Mill plugin to build container images with Native Image (GraalVM Binaries) application
Scala
12
star
18

openshift-playbooks

Ansible playbooks for multiple Openshift deploy/management tasks
Jinja
12
star
19

diameter-dcca

Erlang Diameter Credit Control Application (DCCA) Server and Client (Discontinued in favor of OTP versions)
Erlang
11
star
20

chisel-fpga-pinfinder

A Chisel implementation for an FPGA Pin Finder thru UART
Scala
11
star
21

zio-channel

Prototype library for Go-like channels in Scala 3 / ZIO 2
Scala
11
star
22

minecraft-server-arm64

Minecraft Server on Docker container for ARM64
Shell
10
star
23

riscvassembler

A RISC-V assembler library for Scala/Chisel HDL projects
Scala
9
star
24

kube-mediaserver

Kubernetes Media Server stack
Dockerfile
9
star
25

Reason-KorgNanoKontrol2-Remote

Propellerhead Reason Korg NanoKontrol2 Remote Script
Lua
8
star
26

container-mgmt

Container management structure
Shell
8
star
27

Reason-MPKMini-Remote

Akai MPK Mini remote script for Reason
Lua
7
star
28

kubernetes-kit

Kubernetes Install kit and guide
Shell
6
star
29

bleepziohttp

Scala Bleep sample project using ZIO and ZIO-HTTP
Scala
6
star
30

qomu_chiselblinky

C
6
star
31

ppc64le-bringup

Tracking and bringing-up projects for the PPC64le architecture
Shell
5
star
32

go-playground

Go playground for projects and apps
Go
5
star
33

carlosedp.github.com

Personal Website/Blog - http://carlosedp.com
SCSS
5
star
34

rebar3_diameter_compiler

Compile Diameter .dia files on Erlang Rebar3 projects
Erlang
5
star
35

dcca-client-OTP

Erlang Diameter Credit Control (DCCA) OTP Client
Erlang
4
star
36

chisel-template

Chisel HDL Template Repository
Scala
4
star
37

BitwigControllers

Bitwig Studio Controller scripts
JavaScript
4
star
38

mill-aliases

A Scala Mill plugin adding task aliases to the build configuration
Scala
4
star
39

stacklessexamples

Python
3
star
40

PMOD1

Documentation and code samples for the PMOD1 - Rotary+RingLED
Scala
3
star
41

scalautils

Scala/Chisel utility methods
Scala
3
star
42

dotfiles

Dotfiles for console configuration on MacOS and Linux
Shell
2
star
43

presentations

Presentations from Talks and Events
2
star
44

carlosedp

About me
2
star
45

MIDI-Footcontroller

MIDI Footcontroller on Arduino
Processing
2
star
46

mill-zsh-completions

Zsh plugin adding Scala Mill build tool completions and prompt display
Shell
2
star
47

homebrew-tap

This is the repository for some custom Homebrew packages
Ruby
2
star
48

rvasmweb

An experimental RISC-V Assembler web app built on Scala.js
Scala
2
star
49

scalatra-demo-metrics

Scala
1
star
50

webdownloader

Web application written in Node.js that allows one to schedule downloads and receive them via email or other sources.
JavaScript
1
star
51

blackbird-openbmc

1
star
52

openhwspaces

OpenHWSpaces repository with discussed topics and reference links
1
star
53

temporal-samples

Scala
1
star