Skip to content

Commit

Permalink
Merge pull request #4012 from flyteorg/prepare-monorepo
Browse files Browse the repository at this point in the history
[Monorepo] - Step 1 - import golang repos
  • Loading branch information
eapolinario authored Sep 7, 2023
2 parents cda745c + 8e1f887 commit 9c91a6d
Show file tree
Hide file tree
Showing 2,703 changed files with 343,453 additions and 0 deletions.
15 changes: 15 additions & 0 deletions datacatalog/.github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Comment to be posted on PRs from first-time contributors in your repository
newPRWelcomeComment: >
Thank you for opening this pull request! 🙌
These tips will help get your PR across the finish line:
- Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
- Sign off your commits (Reference: [DCO Guide](https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md)).
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congrats on merging your first pull request! 🎉
# Comment to be posted on first-time issues
newIssueWelcomeComment: >
Thank you for opening your first issue here! 🛠
66 changes: 66 additions & 0 deletions datacatalog/.github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Datacatalog Checks

on:
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
lint:
name: Lint
uses: flyteorg/flytetools/.github/workflows/lint.yml@master
with:
go-version: "1.19"

tests:
name: Unit Tests
uses: flyteorg/flytetools/.github/workflows/tests.yml@master
with:
go-version: "1.19"
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}

docker_build:
name: Docker Build Images
uses: flyteorg/flytetools/.github/workflows/docker_build.yml@master

generate:
name: Check Go Gennerate
uses: flyteorg/flytetools/.github/workflows/go_generate.yml@master
with:
go-version: "1.19"

bump_version:
name: Bump Version
if: ${{ github.event_name != 'pull_request' }}
needs: [ docker_build, lint, tests, generate ] # Only to ensure it can successfully build
uses: flyteorg/flytetools/.github/workflows/bump_version.yml@master
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}

goreleaser:
name: Goreleaser
needs: [ bump_version ] # Only to ensure it can successfully build
uses: flyteorg/flytetools/.github/workflows/goreleaser.yml@master
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
with:
go-version: "1.19"

push_docker_image:
name: Build & Push Datacatalog Image
needs: [ bump_version ]
uses: flyteorg/flytetools/.github/workflows/publish.yml@master
with:
version: ${{ needs.bump_version.outputs.version }}
dockerfile: Dockerfile
push: true
repository: ${{ github.repository }}
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }}

21 changes: 21 additions & 0 deletions datacatalog/.github/workflows/upgrade_automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Upgrade Automation
on:
workflow_dispatch:
inputs:
component:
description: "Name of Flyte component"
required: true
default: "boilerplate"
type: choice
options:
- boilerplate
- flyteidl
jobs:
trigger-upgrade:
name: ${{ github.event.inputs.component }} Upgrade
uses: flyteorg/flytetools/.github/workflows/flyte_automation.yml@master
with:
component: ${{ github.event.inputs.component }}
go-version: "1.19"
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
5 changes: 5 additions & 0 deletions datacatalog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea/
vendor/
vendor-new/
.DS_Store
bin/
30 changes: 30 additions & 0 deletions datacatalog/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

run:
skip-dirs:
- pkg/client

linters:
disable-all: true
enable:
- deadcode
- errcheck
- gas
- goconst
- goimports
- golint
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
35 changes: 35 additions & 0 deletions datacatalog/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
project_name: datacatalog
before:
hooks:
- go mod download
builds:
- id: datacatalog
env:
- CGO_ENABLED=0
main: ./cmd/main.go
binary: datacatalog
goos:
- linux
- windows
- darwin
archives:
- id: datacatalog-archive
name_template: |-
datacatalog_{{ .Tag }}_{{ .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
builds:
- datacatalog
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
3 changes: 3 additions & 0 deletions datacatalog/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are the assigned owners of the datacatalog repo.
# When a PR is opened they will be notified.
* @kumare3 @wild-endeavor
2 changes: 2 additions & 0 deletions datacatalog/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This project is governed by LF AI Foundation's [code of conduct](https://lfprojects.org/policies/code-of-conduct/).
All contributors and participants agree to abide by its terms.
53 changes: 53 additions & 0 deletions datacatalog/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

FROM --platform=${BUILDPLATFORM} golang:1.19-alpine3.16 as builder

ARG TARGETARCH
ENV GOARCH "${TARGETARCH}"
ENV GOOS linux

RUN apk add git openssh-client make curl

# Create the artifacts directory
RUN mkdir /artifacts

# Pull GRPC health probe binary for liveness and readiness checks
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.11 && \
wget -qO/artifacts/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /artifacts/grpc_health_probe && \
echo 'ded15e598d887ccc47bf2321371950bbf930f5e4856b9f75712ce4b2b5120480 /artifacts/grpc_health_probe' > .grpc_checksum && \
sha256sum -c .grpc_checksum

# COPY only the go mod files for efficient caching
COPY go.mod go.sum /go/src/github.com/flyteorg/datacatalog/
WORKDIR /go/src/github.com/flyteorg/datacatalog

# Pull dependencies
RUN go mod download

# COPY the rest of the source code
COPY . /go/src/github.com/flyteorg/datacatalog/

# This 'linux_compile' target should compile binaries to the /artifacts directory
# The main entrypoint should be compiled to /artifacts/datacatalog
RUN make linux_compile

# update the PATH to include the /artifacts directory
ENV PATH="/artifacts:${PATH}"

# This will eventually move to centurylink/ca-certs:latest for minimum possible image size
FROM alpine:3.16
LABEL org.opencontainers.image.source=https://github.com/flyteorg/datacatalog

COPY --from=builder /artifacts /bin

# Ensure the latest CA certs are present to authenticate SSL connections.
RUN apk --update add ca-certificates

RUN addgroup -S flyte && adduser -S flyte -G flyte
USER flyte

CMD ["datacatalog"]
Loading

0 comments on commit 9c91a6d

Please sign in to comment.