This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate filecoin-ffi relace directive
- Loading branch information
Showing
9 changed files
with
153 additions
and
23 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,3 @@ | ||
.github | ||
extern | ||
*.md |
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,8 @@ | ||
name: Go Check Setup | ||
description: Set up the environment for go check | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install filecoin-ffi | ||
shell: bash | ||
run: make extern/filecoin-ffi |
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,8 @@ | ||
name: Go Test Setup | ||
description: Set up the environment for go test | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install filecoin-ffi | ||
shell: bash | ||
run: make extern/filecoin-ffi |
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 @@ | ||
extern |
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 |
---|---|---|
@@ -1,13 +1,23 @@ | ||
FROM golang:1.20-bullseye as build | ||
|
||
WORKDIR /go/src/motion | ||
COPY go.* ./ | ||
|
||
RUN apt-get update && apt-get install -y libhwloc-dev ocl-icd-opencl-dev jq | ||
COPY Makefile . | ||
RUN make extern/filecoin-ffi | ||
|
||
COPY go.* . | ||
RUN go mod download | ||
|
||
COPY . . | ||
RUN CGO_ENABLED=1 go build -o /go/bin/motion ./cmd/motion | ||
|
||
FROM gcr.io/distroless/base-debian11 | ||
COPY --from=build /go/bin/motion /usr/bin/ | ||
COPY --from=build /go/src/motion/extern/filecoin-ffi/filcrypto.h \ | ||
/go/src/motion/extern/filecoin-ffi/filcrypto.pc \ | ||
/go/src/motion/extern/filecoin-ffi/libfilcrypto.a \ | ||
/usr/lib/*/libhwloc.so.15 \ | ||
/usr/lib/ | ||
|
||
ENTRYPOINT ["/usr/bin/motion"] |
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 @@ | ||
SHELL=/usr/bin/env bash | ||
.DEFAULT_GOAL := build | ||
|
||
FILECOIN_FFI_VERSION=de34caff946d598e | ||
FILECOIN_FFI_HOME=extern/filecoin-ffi | ||
|
||
.PHONY: build | ||
build: extern/filecoin-ffi | ||
go build ./... | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf ./$(FILECOIN_FFI_HOME) | ||
|
||
extern/filecoin-ffi: | ||
git clone --depth 1 https://github.com/filecoin-project/filecoin-ffi.git $(FILECOIN_FFI_HOME) && \ | ||
cd $(FILECOIN_FFI_HOME) && \ | ||
git fetch origin $(FILECOIN_FFI_VERSION) && \ | ||
git checkout $(FILECOIN_FFI_VERSION) && \ | ||
$(MAKE) | ||
|
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.