Skip to content

Commit

Permalink
Merge pull request #61 from mogeko/dev
Browse files Browse the repository at this point in the history
Compile from the local source code
  • Loading branch information
mogeko authored Nov 16, 2024
2 parents 7de5d15 + cf0b296 commit befef33
Show file tree
Hide file tree
Showing 580 changed files with 103,446 additions and 64 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- run: make build run
- uses: actions/checkout@v4.2.2
- uses: redhat-actions/buildah-build@v2.13
with:
image: localhost/vlmcsd
tags: latest
containerfiles: ./Dockerfile
- run: podman run --rm localhost/vlmcsd:latest -V
- name: Run and test containers
run: |
podman run -d --name vlmcsd localhost/vlmcsd:latest
podman exec vlmcsd /usr/bin/vlmcs 0.0.0.0:1688
podman rm -f vlmcsd
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
name: update-bot
name: Release

on:
schedule:
- cron: "30 23 * * *"
push:
tags: ["*"]
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
outputs:
is_update: ${{ steps.check_ver.outputs.is_update }}
stable_ver: ${{ steps.check_ver.outputs.stable_ver }}
docker_tags: ${{ steps.check_ver.outputs.docker_tags }}
steps:
- name: Check version
id: check_ver
uses: mogeko/latest-version@master
with:
repo: Wind4/vlmcsd

build:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.is_update == 'true'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- name: Log in to Docker Hub
uses: redhat-actions/podman-login@v1.7
with:
Expand All @@ -47,9 +32,6 @@ jobs:
images: |
docker.io/${{ secrets.DOCKER_USERNAME }}/vlmcsd
ghcr.io/${{ github.actor }}/vlmcsd
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
${{ needs.check.outputs.docker_tags }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3.2.0
with:
Expand All @@ -58,12 +40,12 @@ jobs:
uses: redhat-actions/buildah-build@v2.13
id: build-image
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
containerfiles: ./Dockerfile
build-args: |
VERSION=${{ needs.check.outputs.stable_ver }}
VLMCSD_VERSION=${{ github.ref_name }}
layers: false
- name: Push to Container registry
uses: redhat-actions/push-to-registry@v2.8
Expand Down
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,62 @@ Temporary Items
*.icloud

# End of https://www.toptal.com/developers/gitignore/api/Macos

# C
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# Build output
vlmcsd-1113/bin/
vlmcsd-1113/build/
vlmcsd-1113/lib/
24 changes: 13 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
FROM docker.io/library/debian:12 as builder
FROM docker.io/library/debian:12 AS builder

ARG VERSION=svn1113

ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get -y install \
build-essential ca-certificates clang && \
rm -rf /var/lib/apt/lists/*

WORKDIR /opt/source
COPY ./vlmcsd-*/etc /opt/vlmcsd/etc
COPY ./vlmcsd-*/src /opt/vlmcsd/src
COPY ./vlmcsd-*/GNUmakefile /opt/vlmcsd/GNUmakefile
COPY ./vlmcsd-*/Makefile /opt/vlmcsd/Makefile

ADD https://github.com/Wind4/vlmcsd/archive/${VERSION}.tar.gz /tmp
RUN tar -xzf /tmp/${VERSION}.tar.gz --strip-components=1 && \
CC="clang" make vlmcsd vlmcs -j$(nproc)
ARG VLMCSD_VERSION="private\ build"
ARG CC="clang"
ENV CC="${CC}" VLMCSD_VERSION="${VLMCSD_VERSION}"
RUN make -C /opt/vlmcsd -j$(nproc)

FROM gcr.io/distroless/base-nossl-debian12:nonroot

LABEL org.opencontainers.image.description="A rootless container running vlmcsd"
LABEL org.opencontainers.image.author="Zheng Junyi <zhengjunyi@live.comn>"
LABEL org.opencontainers.image.licenses="MIT"

COPY --from=builder /opt/source/bin/vlmcsd /usr/bin/vlmcsd
COPY --from=builder /opt/source/etc /etc/vlmcsd
COPY --from=builder /opt/vlmcsd/bin/vlmcsd /usr/bin/vlmcsd
COPY --from=builder /opt/vlmcsd/etc /etc/vlmcsd

EXPOSE 1688/tcp

ENTRYPOINT [ "/usr/bin/vlmcsd" ]
CMD [ "-D", "-d", "-e" ]

COPY --from=builder /opt/source/bin/vlmcs /usr/bin/vlmcs
COPY --from=builder /opt/vlmcsd/bin/vlmcs /usr/bin/vlmcs
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD [ "/usr/bin/vlmcs", "0.0.0.0:1688" ]
26 changes: 0 additions & 26 deletions Makefile

This file was deleted.

Loading

0 comments on commit befef33

Please sign in to comment.