Skip to content

Commit

Permalink
Merge pull request #65 from dweomer/initial-move-to-k3s-io
Browse files Browse the repository at this point in the history
initial move to k3s-io
  • Loading branch information
dweomer authored Nov 20, 2020
2 parents 31fbd94 + 34f0ce3 commit 30047c8
Show file tree
Hide file tree
Showing 19 changed files with 160 additions and 135 deletions.
116 changes: 67 additions & 49 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
kind: pipeline
type: docker
name: amd64

platform:
Expand All @@ -8,9 +9,11 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.2
image: rancher/dapper:v0.5.0
environment:
ARCH: "${DRONE_STAGE_ARCH}"
commands:
- dapper ci
- dapper --file Dockerfile --target dapper ci
volumes:
- name: docker
path: /var/run/docker.sock
Expand All @@ -20,40 +23,42 @@ steps:
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-amd64.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
- dist/artifacts/*
prerelease: true
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
build_args:
ARCH: amd64
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: "rancher/kine"
target: release
repo: rancher/kine
tag: "${DRONE_TAG}-amd64"
username:
from_secret: docker_username
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
Expand All @@ -62,6 +67,7 @@ volumes:

---
kind: pipeline
type: docker
name: arm64

platform:
Expand All @@ -70,9 +76,11 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.2
image: rancher/dapper:v0.5.0
environment:
ARCH: "${DRONE_STAGE_ARCH}"
commands:
- dapper ci
- dapper --file Dockerfile --target dapper ci
volumes:
- name: docker
path: /var/run/docker.sock
Expand All @@ -82,40 +90,42 @@ steps:
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-arm64.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
- dist/artifacts/*
prerelease: true
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
build_args:
ARCH: arm64
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: "rancher/kine"
target: release
repo: rancher/kine
tag: "${DRONE_TAG}-arm64"
username:
from_secret: docker_username
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
Expand All @@ -124,6 +134,7 @@ volumes:

---
kind: pipeline
type: docker
name: arm

platform:
Expand All @@ -132,9 +143,11 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.2
image: rancher/dapper:v0.5.0
environment:
ARCH: "${DRONE_STAGE_ARCH}"
commands:
- dapper ci
- dapper --file Dockerfile --target dapper ci
volumes:
- name: docker
path: /var/run/docker.sock
Expand All @@ -144,40 +157,42 @@ steps:
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-arm.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
- dist/artifacts/*
prerelease: true
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
build_args:
ARCH: arm
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: "rancher/kine"
target: release
repo: rancher/kine
tag: "${DRONE_TAG}-arm"
username:
from_secret: docker_username
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

volumes:
- name: docker
Expand All @@ -186,6 +201,7 @@ volumes:

---
kind: pipeline
type: docker
name: manifest

platform:
Expand All @@ -194,28 +210,30 @@ platform:

steps:
- name: manifest
image: plugins/manifest:1.0.2
image: plugins/manifest
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm
- linux/amd64
- linux/arm64
- linux/arm
target: "rancher/kine:${DRONE_TAG}"
template: "rancher/kine:${DRONE_TAG}-ARCH"
when:
event:
- tag
instance:
- drone-publish.rancher.io
- drone-publish.k3s.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag

depends_on:
- amd64
- arm64
- arm

...
43 changes: 34 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
FROM golang:1.13.7-alpine3.11 AS builder
RUN apk --no-cache add gcc musl-dev
WORKDIR /go/src/github.com/rancher/kine
COPY . .
RUN GO111MODULE=on go build -o /bin/kine

FROM alpine:3.11
COPY --from=builder /bin/kine /bin/kine
ENTRYPOINT ["/bin/kine"]
FROM golang:1.15-alpine3.12 AS dapper

ARG ARCH=amd64

RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates
RUN go get -d golang.org/x/lint/golint && \
git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
go install golang.org/x/lint/golint && \
rm -rf /go/src /go/pkg
RUN mkdir -p /go/src/golang.org/x && \
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
git -C /go/src/golang.org/x/tools checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
go install golang.org/x/tools/cmd/goimports
RUN rm -rf /go/src /go/pkg

RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.27.0; \
fi

ENV DAPPER_RUN_ARGS --privileged
ENV DAPPER_ENV ARCH REPO TAG DRONE_TAG IMAGE_NAME CROSS
ENV DAPPER_SOURCE /go/src/github.com/k3s-io/kine/
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}

ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]

FROM alpine:3.12 AS release
ARG ARCH=amd64
COPY dist/artifacts/kine-${ARCH} /bin/kine
ENTRYPOINT ["/bin/kine"]
32 changes: 0 additions & 32 deletions Dockerfile.dapper

This file was deleted.

10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
## Kine (Kine is not etcd)
# Kine (Kine is not etcd)
==========================

_NOTE: this repository has been recently (2020-11-19) moved out of the github.com/rancher org to github.com/k3s-io
supporting the [acceptance of K3s as a CNCF sandbox project](https://github.com/cncf/toc/pull/447)_.

---

Kine is an etcdshim that translates etcd API to sqlite, Postgres, Mysql, and dqlite

### Features
## Features
- Can be ran standalone so any k8s (not just k3s) can use Kine
- Implements a subset of etcdAPI (not usable at all for general purpose etcd)
- Translates etcdTX calls into the desired API (Create, Update, Delete)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/rancher/kine
module github.com/k3s-io/kine

go 1.12
go 1.15

require (
github.com/Rican7/retry v0.1.0
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"os"

"github.com/rancher/kine/pkg/endpoint"
"github.com/k3s-io/kine/pkg/endpoint"
"github.com/rancher/wrangler/pkg/signals"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/rancher/kine/pkg/endpoint"
"github.com/k3s-io/kine/pkg/endpoint"
"go.etcd.io/etcd/clientv3"
)

Expand Down
Loading

0 comments on commit 30047c8

Please sign in to comment.