Skip to content

Commit

Permalink
Merge pull request #2 from celestiaorg/jose/torch-v1
Browse files Browse the repository at this point in the history
feat(torch): v1 resources added
  • Loading branch information
tty47 committed Oct 30, 2023
2 parents e31e327 + 76b8f07 commit 6ae5bd1
Show file tree
Hide file tree
Showing 35 changed files with 2,233 additions and 790 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ torch
.DS_Store
.idea

*otel-agent-celestia.yaml
*otel-agent-*.yaml
32 changes: 29 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
FROM golang:1.21.0-bullseye AS builder
# stage 1 Generate torch Binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder

ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0
ENV GO111MODULE=on

WORKDIR /

COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /go/bin/torch ./cmd/main.go
RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /go/bin/torch ./cmd/main.go

FROM alpine:latest
# stage 2
FROM docker.io/alpine:3.18.4
WORKDIR /
# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
ARG USER_NAME=torch

ENV USR_HOME=/home/${USER_NAME}

# hadolint ignore=DL3018
RUN adduser ${USER_NAME} \
-D \
-g ${USER_NAME} \
-h ${USR_HOME} \
-s /sbin/nologin \
-u ${UID}

COPY --from=builder /go/bin/torch .

EXPOSE 8080

ENTRYPOINT ["./torch"]
30 changes: 28 additions & 2 deletions Dockerfile_local
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
FROM golang:1.21.0-bullseye AS builder
# stage 1 Generate torch Binary
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21.3-alpine3.18 as builder

ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0
ENV GO111MODULE=on

WORKDIR /

COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
COPY torch /go/bin/torch

FROM alpine:latest
# stage 2
FROM docker.io/alpine:3.18.4
WORKDIR /
# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
ARG USER_NAME=torch

ENV USR_HOME=/home/${USER_NAME}

# hadolint ignore=DL3018
RUN adduser ${USER_NAME} \
-D \
-g ${USER_NAME} \
-h ${USR_HOME} \
-s /sbin/nologin \
-u ${UID}

COPY --from=builder /go/bin/torch .

EXPOSE 8080

ENTRYPOINT ["./torch"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PROJECT_NAME := $(shell basename `pwd`)
REPOSITORY_NAME := $(shell basename `pwd`)
REGISTRY_NAME=ghcr.io/jrmanes
REGISTRY_NAME=ghcr.io/celestiaorg
LOCAL_DEV=local

# Go
Expand Down Expand Up @@ -69,4 +69,4 @@ kubectl_deploy: docker_build_local_push kubectl_apply
.PHYONY: kubectl_deploy

kubectl_remote_kustomize_deploy: docker_build_local_push_gh kubectl_kustomize
.PHYONY: kubectl_remote_kustomize_deploys
.PHYONY: kubectl_remote_kustomize_deploy
Loading

0 comments on commit 6ae5bd1

Please sign in to comment.