Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Jul 6, 2022
0 parents commit 912b76a
Show file tree
Hide file tree
Showing 803 changed files with 113,940 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }}

> {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}

{{ range .Commits -}}
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}

{{- if .RevertCommits -}}
### Reverts

{{ range .RevertCommits -}}
* {{ .Revert.Header }}
{{ end }}
{{ end -}}

{{- if .MergeCommits -}}
### Pull Requests

{{ range .MergeCommits -}}
* {{ .Header }}
{{ end }}
{{ end -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}

{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
28 changes: 28 additions & 0 deletions .chglog/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/ovrclk/akash
options:
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
13 changes: 13 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
GOLANG_VERSION=1.18.3
KIND_VERSION=0.11.1
KINDEST_VERSION=v1.21.1
GO111MODULE=on
ROOT_DIR=${AP_ROOT}
AP_DEVCACHE_BASE=${AP_ROOT}/.cache
AP_DEVCACHE=${AP_DEVCACHE_BASE}
AP_DEVCACHE_BIN=${AP_DEVCACHE}/bin
AP_DEVCACHE_INCLUDE=${AP_DEVCACHE}/include
AP_DEVCACHE_VERSIONS=${AP_DEVCACHE}/versions
AP_DEVCACHE_NODE_MODULES=${AP_DEVCACHE}
AP_DEVCACHE_NODE_BIN=${AP_DEVCACHE_NODE_MODULES}/node_modules/.bin
DEVCACHE_RUN=${AP_DEVCACHE}/run
15 changes: 15 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
AP_ROOT=$(pwd)
export AP_ROOT

dotenv

PATH_add "$AP_DEVCACHE_NODE_BIN"
PATH_add "$AP_DEVCACHE_BIN"

make cache

PROVIDER_SERVICES=$AP_DEVCACHE_BIN/provider-services
AKASH=$AP_DEVCACHE_BIN/akash

export PROVIDER_SERVICES
export AKASH
45 changes: 45 additions & 0 deletions .github/workflows/k8s-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: k8s-integration

on:
push:
branches:
- main
pull_request:

jobs:
crd-e2e:
env:
KIND_NAME: kind
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GOLANG_VERSION }}"
- uses: engineerd/[email protected]
with:
version: "v${{ env.KIND_VERSION }}"
image: "kindest/node:${{ env.KINDEST_VERSION }}"
config: ./_run/kube/kind-config.yaml
- name: Docker Status
run: docker ps -a
- name: Setup Ingress K8S
run: make -s -C _run/kube kind-ingress-setup
- name: k8s-ingress
run: make -s -C _run/kube kind-k8s-ip
- name: Kube Environment
run: |
kubectl config view
kubectl cluster-info
kubectl get pods,ingress,svc -A
- name: Run E2E Tests
run: make test-e2e-integration
- name: Run K8s Tests
run: make test-k8s-integration
- name: Post-Run Kube Environment
run: |
kubectl get ns,pods,ingress,svc -A
54 changes: 54 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: release

defaults:
run:
shell: bash

on:
push:
branches:
- main
tags:
- v*

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GOLANG_VERSION }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: branch name
id: branch_name
run: |
echo ::set-output name=RELEASE_TAG::${GITHUB_REF#refs/tags/}
- if: (github.ref == 'refs/heads/main')
name: release dry-run GORELEASER_SKIP_VALIDATE=true
run: make release-dry-run GORELEASER_SKIP_VALIDATE=true
- if: startsWith(github.ref,'refs/tags/v')
name: release dry-run
run: make release-dry-run
env:
RELEASE_TAG: ${{ steps.branch_name.outputs.RELEASE_TAG }}
- if: startsWith(github.ref,'refs/tags/v') && github.repository == 'ovrclk/provider-services'
name: setup release environment
run: |-
echo '${{secrets.GHCR_USER}}:${{secrets.GHCR_TOKEN}}:ghcr.io' > .docker-creds
echo 'DOCKER_CREDS_FILE=.docker-creds' > .release-env
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_ACCESS_TOKEN}}' >> .release-env
- if: startsWith(github.ref,'refs/tags/v') && github.repository == 'ovrclk/provider-services'
name: release publish
run: |-
sudo rm -rf dist
make release
env:
RELEASE_TAG: ${{ steps.branch_name.outputs.RELEASE_TAG }}
18 changes: 18 additions & 0 deletions .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: shellcheck

on:
push:
branches:
- master
- mainnet/main
pull_request:
branches:
- master
- mainnet/main

jobs:
shellcheck-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make shellcheck
15 changes: 15 additions & 0 deletions .github/workflows/standardize-yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: standardize yaml
on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
check-yml-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: check-yml-count
run: |
if [[ $(git ls-files '*.yml' ':!:codecov.yml' | wc -l) -ne 0 ]]; then git ls-files '*.yml' ':!:codecov.yml' && exit 1;fi
54 changes: 54 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: tests

on:
pull_request:
push:
branches:
- main

jobs:
build-bins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GOLANG_VERSION }}"
- run: make provider-services
- run: make docker-image

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GOLANG_VERSION }}"
- run: make test-full

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- uses: actions/setup-go@v2
with:
go-version: "${{ env.GOLANG_VERSION }}"
- run: make modvendor
- run: make build
- run: make test-vet
- name: lint all
run: make test-lint-all
- name: lint make-sublinters
run: make test-sublinters
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Go template
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
vendor/
.cache/

# goreleaser build dir
dist

.idea/
*.iml
.vscode
coverage.txt
13 changes: 13 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
issues:
exclude:
- comment on exported (method|function|type|const|var)
exclude-use-default: true

# Skip generated k8s code
run:
skip-dirs:
- pkg/client
- ".*/mocks"

# Skip vendor/ etc
skip-dirs-use-default: true
51 changes: 51 additions & 0 deletions .goreleaser-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
env:
- GO111MODULE=on
- DOCKER_CLI_EXPERIMENTAL="enabled"
builds:
- id: provider-services-linux
binary: provider-services
main: ./cmd/provider-services
goarch:
- amd64
- arm64
goos:
- linux
flags:
- "-mod={{ .Env.MOD }}"
- "-tags={{ .Env.BUILD_TAGS }}"
- -trimpath
ldflags:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"

dockers:
- dockerfile: Dockerfile
use: buildx
goarch: amd64
goos: linux
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url={{.GitURL}}
- --label=org.opencontainers.image.source={{.GitURL}}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
image_templates:
- 'ghcr.io/ovrclk/{{ .ProjectName }}:latest-amd64'
- dockerfile: Dockerfile
use: buildx
goarch: arm64
goos: linux
build_flag_templates:
- --platform=linux/arm64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url={{.GitURL}}
- --label=org.opencontainers.image.source={{.GitURL}}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
image_templates:
- 'ghcr.io/ovrclk/{{ .ProjectName }}:latest-arm64'
Loading

0 comments on commit 912b76a

Please sign in to comment.