-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add http server. Addying retryer and clean up md5 files, too. Adding more stuff. Add README. Add metrics server. Adding more metrics. Fix retryer, add health endpoint. Fixes. Fix config init for env vars. First remove, then add. Some more logging. Minor.
- Loading branch information
Showing
23 changed files
with
1,779 additions
and
669 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,30 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
|
||
template: | | ||
## General Changes | ||
$CHANGES | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
|
||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch |
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,34 @@ | ||
name: Build latest image | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_REGISTRY_USER }} | ||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.32.2 | ||
|
||
- name: Build and push Docker image | ||
run: | | ||
docker build -t ghcr.io/metal-stack/metal-image-cache-sync . | ||
docker push ghcr.io/metal-stack/metal-image-cache-sync | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,40 @@ | ||
name: Build image from pull request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Figure out if running fork PR | ||
id: fork | ||
run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"' | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_REGISTRY_USER }} | ||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | ||
if: steps.fork.outputs.is_fork_pr == 'false' | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.32.2 | ||
|
||
- name: Build Docker image | ||
run: | | ||
docker build -t ghcr.io/metal-stack/metal-image-cache-sync:pr-${GITHUB_HEAD_REF##*/} . | ||
- name: Push Docker image | ||
run: | | ||
# pull request images are prefixed with 'pr' to prevent them from overriding released images | ||
docker push ghcr.io/metal-stack/metal-image-cache-sync:pr-${GITHUB_HEAD_REF##*/} | ||
if: steps.fork.outputs.is_fork_pr == 'false' |
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,30 @@ | ||
name: Build image from release tag | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_REGISTRY_USER }} | ||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.32.2 | ||
|
||
- name: Build and push Docker image | ||
run: | | ||
docker build -t ghcr.io/metal-stack/metal-image-cache-sync:${GITHUB_REF##*/} . | ||
docker push ghcr.io/metal-stack/metal-image-cache-sync:${GITHUB_REF##*/} |
Validating CODEOWNERS rules …
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 @@ | ||
* @metal-stack/metal-image-cache-sync-maintainers |
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 @@ | ||
# Contributing | ||
|
||
Please check out the [contributing section](https://docs.metal-stack.io/stable/development/contributing/) in our [docs](https://docs.metal-stack.io/). |
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,6 @@ | ||
FROM metalstack/builder:latest as builder | ||
|
||
FROM alpine:3.12 | ||
RUN apk add --no-cache tini ca-certificates | ||
COPY --from=builder /work/bin/metal-image-cache-sync /metal-image-cache-sync | ||
CMD ["/metal-image-cache-sync"] |
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) 2020 The metal-stack Authors. | ||
|
||
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 |
---|---|---|
@@ -1,7 +1,25 @@ | ||
BINARY := metal-image-cache-sync | ||
MAINMODULE := github.com/metal-stack/metal-image-cache-sync | ||
MAINMODULE := github.com/metal-stack/metal-image-cache-sync/cmd | ||
COMMONDIR := $(or ${COMMONDIR},../builder) | ||
|
||
# default points to mini-lab | ||
METAL_API_ENDPOINT := $(or ${METALCTL_URL},http://api.0.0.0.0.xip.io:8080/metal) | ||
METAL_API_HMAC := $(or ${METALCTL_HMAC},metal-view) | ||
|
||
include $(COMMONDIR)/Makefile.inc | ||
|
||
release:: spec all; | ||
.PHONY: all | ||
all:: | ||
go mod tidy | ||
|
||
release:: all; | ||
|
||
.PHONY: start | ||
start: all | ||
bin/metal-image-cache-sync \ | ||
--metal-api-endpoint $(METAL_API_ENDPOINT) \ | ||
--metal-api-hmac $(METAL_API_HMAC) \ | ||
--max-cache-size 10G \ | ||
--min-images-per-name 2 \ | ||
--root-path /tmp/metal-image-cache \ | ||
--dry-run |
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 @@ | ||
# metal-image-cache-sync | ||
|
||
Intelligently syncs metal-stack images into a partition in order to speed up machine provisioning and reduce internet traffic. |
Oops, something went wrong.