-
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.
- Loading branch information
0 parents
commit dec8cb1
Showing
99 changed files
with
8,245 additions
and
0 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,2 @@ | ||
*.out | ||
/Halide-Runtime |
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,5 @@ | ||
*.swp | ||
.DS_Store | ||
|
||
*.out | ||
/Halide-Runtime |
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,50 @@ | ||
# syntax=docker/dockerfile:experimental | ||
FROM golang:1.16-alpine as goget | ||
|
||
COPY go.mod go.sum /go/src/github.com/octu0/blurry/ | ||
|
||
RUN set -eux && \ | ||
apk add --no-cache --virtual .build-deps git wget openssh-client && \ | ||
cd /go/src/github.com/octu0/blurry && \ | ||
go mod download && \ | ||
apk del .build-deps | ||
|
||
# ---------------------------------- | ||
FROM golang:1.16 as builder | ||
COPY --from=goget /go/bin/ /go/bin/ | ||
COPY --from=goget /go/src/ /go/src/ | ||
COPY --from=goget /go/pkg/ /go/pkg/ | ||
|
||
WORKDIR /build | ||
|
||
ADD . /go/src/github.com/octu0/blurry/ | ||
|
||
RUN set -eux && \ | ||
apt-get clean && \ | ||
apt-get update -y && \ | ||
apt-get install -y gcc libc-dev libc++-dev g++ clang wget libtinfo5 libclang-dev | ||
|
||
RUN set -eux && \ | ||
cd /go/src/github.com/octu0/blurry && \ | ||
GOOS=linux GOARCH=amd64 go build -o /build/blurry \ | ||
cmd/bridge/main.go \ | ||
&& \ | ||
/build/blurry --version | ||
|
||
RUN set -eux && \ | ||
apt-get remove -y gcc libc-dev && \ | ||
apt-get purge -y && \ | ||
apt-get autoclean | ||
|
||
# ---------------------------------- | ||
|
||
FROM golang:1.16 | ||
|
||
WORKDIR /app | ||
COPY --from=builder /build/blurry /app | ||
|
||
RUN set -eux && \ | ||
/app/blurry --version | ||
|
||
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
ENTRYPOINT [ "docker-entrypoint.sh" ] |
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,18 @@ | ||
FROM ubuntu:20.04 as halide-runtime | ||
|
||
WORKDIR /halide | ||
|
||
RUN set -eux && \ | ||
apt update && \ | ||
apt install -y wget && \ | ||
wget https://github.com/halide/Halide/releases/download/v11.0.1/Halide-11.0.1-x86-64-linux-85c1b91c47ce15aab0d9502d955e48615f3bcee0.tar.gz && \ | ||
tar xzf Halide-11.0.1-x86-64-linux-85c1b91c47ce15aab0d9502d955e48615f3bcee0.tar.gz && \ | ||
rm Halide-11.0.1-x86-64-linux-85c1b91c47ce15aab0d9502d955e48615f3bcee0.tar.gz && \ | ||
mv Halide-11.0.1-x86-64-linux Halide-Runtime | ||
|
||
RUN set -eux && \ | ||
apt update && \ | ||
apt install -y clang g++ binutils libpng-dev libjpeg-dev | ||
|
||
COPY docker-entrypoint.generator.sh /usr/local/bin/docker-entrypoint.generator.sh | ||
ENTRYPOINT [ "docker-entrypoint.generator.sh" ] |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Yusuke Hata | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,56 @@ | ||
VERSION_GO = version.go | ||
|
||
_NAME = $(shell grep -o 'AppName string = "[^"]*"' $(VERSION_GO) | cut -d '"' -f2) | ||
_VERSION = $(shell grep -oE 'Version string = "[0-9]+\.[0-9]+\.[0-9]+"' $(VERSION_GO) | cut -d '"' -f2) | ||
|
||
_HALIDE = "generator" | ||
_HALIDE_VER = "11.0.1" | ||
|
||
.PHONY: vet | ||
vet: | ||
go vet ./ | ||
|
||
.PHONY: test | ||
test: | ||
go test -v ./... | ||
|
||
ifeq ($(shell uname),Darwin) | ||
.PHONY: setup-halide | ||
setup-halide: | ||
brew install halide | ||
|
||
.PHONY: setup-halide-runtime | ||
setup-halide-runtime: | ||
ifeq ($(shell [ -d ./Halide-Runtime ] && echo "1"),1) | ||
@echo "./Halide-Runtime exists" | ||
else | ||
curl -O -sSL https://github.com/halide/Halide/releases/download/v11.0.1/Halide-11.0.1-x86-64-osx-85c1b91c47ce15aab0d9502d955e48615f3bcee0.tar.gz | ||
tar xzf Halide-11.0.1-x86-64-osx-85c1b91c47ce15aab0d9502d955e48615f3bcee0.tar.gz | ||
mv Halide-11.0.1-x86-64-osx ./Halide-Runtime | ||
rm Halide-11.0.1-x86-64-osx-85c1b91c47ce15aab0d9502d955e48615f3bcee0.tar.gz | ||
endif | ||
endif | ||
|
||
.PHONY: build-generator | ||
build-generator: | ||
docker build -f Dockerfile.generator -t $(_HALIDE):$(_HALIDE_VER) . | ||
docker tag $(_HALIDE):$(_HALIDE_VER) $(_NAME):latest | ||
|
||
.PHONY: generate | ||
generate: build-generator | ||
docker run --rm \ | ||
-v $(PWD):/app -v $(PWD):/out $(_HALIDE):$(_HALIDE_VER) | ||
|
||
.PHONY: build | ||
build: | ||
docker build -t $(_NAME):$(_VERSION) . | ||
docker tag $(_NAME):$(_VERSION) $(_NAME):latest | ||
|
||
.PHONY: ghpkg | ||
ghpkg: | ||
docker tag $(_NAME):$(_VERSION) docker.pkg.github.com/octu0/blurry/$(_NAME):$(_VERSION) | ||
docker push docker.pkg.github.com/octu0/blurry/$(_NAME):$(_VERSION) | ||
|
||
.PHONY: prune | ||
prune: | ||
docker builder prune |
Oops, something went wrong.