-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added pipeline for arm, changed to musl, fixed openssl issue
- Loading branch information
1 parent
8da0461
commit 6f1ecc2
Showing
9 changed files
with
182 additions
and
19 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
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,81 @@ | ||
# ******************************************************************************** | ||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# *******************************************************************************/ | ||
|
||
name: Containerize UStreamer and Push to Container Registry | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}/zenoh-mqtt-streamer | ||
|
||
jobs: | ||
build-binary: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata and create tag | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: Install Cross | ||
run: | | ||
cargo install cross --git https://github.com/cross-rs/cross | ||
- name: Cross Build for amd64 | ||
working-directory: example-streamer-implementations | ||
run: | | ||
cross build --target aarch64-unknown-linux-musl --bin zenoh_mqtt --features="zenoh-transport mqtt-transport" --release | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: "Dockerfile.zenoh_mqtt-arm-musl" | ||
push: true | ||
platforms: linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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,23 @@ | ||
FROM ghcr.io/cross-rs/x86_64-unknown-linux-musl:latest | ||
## Base rust 'cross' image for compiling on x86:64-unknown-linux-musl (gl-inet) | ||
ENV OPENSSL_V="1.1.1t" | ||
ENV OPENSSL_LIB_DIR=/tmp/openssl-${OPENSSL_V} | ||
ENV OPENSSL_INCLUDE_DIR=/tmp/openssl-${OPENSSL_V}/include | ||
|
||
RUN set -o errexit \ | ||
&& apt-get update \ | ||
&& apt install --yes wget clang g++-multilib \ | ||
&& cd /tmp \ | ||
&& wget https://www.openssl.org/source/openssl-${OPENSSL_V}.tar.gz \ | ||
&& tar xzf openssl-${OPENSSL_V}.tar.gz \ | ||
&& export MACHINE=x86_64 \ | ||
&& export ARCH=x86_64-linux-muslsf \ | ||
&& export CC=${ARCH}-gcc \ | ||
&& cd /tmp/openssl-${OPENSSL_V} \ | ||
&& ./config \ | ||
&& make | ||
|
||
RUN export OPENSSL_V="1.1.1t" \ | ||
&& export OPENSSL_LIB_DIR=/tmp/openssl-${OPENSSL_V} \ | ||
&& export OPENSSL_DIR=/tmp/openssl-${OPENSSL_V} \ | ||
&& export OPENSSL_INCLUDE_DIR=/tmp/openssl-${OPENSSL_V}/include |
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,21 @@ | ||
FROM --platform=linux/amd64 debian:bullseye-slim | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV RUST_LOG=trace | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libc6 \ | ||
libgcc-s1 \ | ||
libstdc++6 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
COPY target/x86_64-unknown-linux-gnu/release/zenoh_mqtt /app/zenoh_mqtt | ||
|
||
RUN chmod +x /app/zenoh_mqtt | ||
|
||
EXPOSE 7447 | ||
EXPOSE 1883 | ||
|
||
CMD ["./zenoh_mqtt", "--config", "config/CONFIG.json5"] |
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,21 @@ | ||
FROM --platform=linux/amd64 debian:bullseye-slim | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV RUST_LOG=trace | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libc6 \ | ||
libgcc-s1 \ | ||
libstdc++6 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
COPY target/x86_64-unknown-linux-gnu/release/zenoh_mqtt /app/zenoh_mqtt | ||
|
||
RUN chmod +x /app/zenoh_mqtt | ||
|
||
EXPOSE 7447 | ||
EXPOSE 1883 | ||
|
||
CMD ["./zenoh_mqtt", "--config", "config/CONFIG.json5"] |
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,10 @@ | ||
FROM scratch | ||
|
||
WORKDIR /app | ||
|
||
COPY target/aarch64-unknown-linux-musl/release/zenoh_mqtt /app/zenoh_mqtt | ||
|
||
EXPOSE 7447 | ||
EXPOSE 1883 | ||
|
||
CMD ["./zenoh_mqtt", "--config", "config/CONFIG.json5"] |
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