Skip to content

Commit

Permalink
Merge 79a5eac into fe2177f
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdoherty4 authored Dec 22, 2022
2 parents fe2177f + 79a5eac commit a7c40ad
Show file tree
Hide file tree
Showing 122 changed files with 408 additions and 21,287 deletions.
2 changes: 0 additions & 2 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ queue_rules:
conditions:
# Conditions to get out of the queue (= merged)
- check-success=DCO
- check-success~=docker-images.*tink-cli
- check-success~=docker-images.*tink-server
- check-success~=docker-images.*tink-worker

Expand All @@ -15,7 +14,6 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- "#review-requested=0"
- check-success=DCO
- check-success~=docker-images.*tink-cli
- check-success~=docker-images.*tink-server
- check-success~=docker-images.*tink-worker
- check-success=crosscompile
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ jobs:
- name: Fetch Nix Packages
run: nix-shell --run 'true'

- name: Install gofumpt for ci-checks.sh
run: make bin/gofumpt

- run: PATH=$PWD/bin/:$PATH ./ci-checks.sh
crosscompile:
runs-on: ubuntu-latest
Expand All @@ -88,12 +85,6 @@ jobs:

- run: make crosscompile -j$(nproc)

- name: Upload tink-cli binaries
uses: actions/upload-artifact@v2
with:
name: tink-cli
path: cmd/tink-cli/tink-cli-*

- name: Upload tink-server binaries
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -124,9 +115,6 @@ jobs:
strategy:
matrix:
include:
- repository: quay.io/tinkerbell/tink-cli
binary: tink-cli

- repository: quay.io/tinkerbell/tink
binary: tink-server

Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ jobs:
DST_REG_USER: ${{ secrets.QUAY_USERNAME }}
DST_REG_PASS: ${{ secrets.QUAY_PASSWORD }}

- name: Copy the tink-cli image using skopeo
run: skopeo copy --all --dest-creds="${DST_REG_USER}":"${DST_REG_PASS}" docker://"${SRC_IMAGE}" docker://"${DST_IMAGE}"
env:
SRC_IMAGE: ${{ env.REGISTRY }}/tinkerbell/tink-cli:${{ env.FROM_TAG }}
DST_IMAGE: ${{ env.REGISTRY }}/tinkerbell/tink-cli:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
DST_REG_USER: ${{ secrets.QUAY_USERNAME }}
DST_REG_PASS: ${{ secrets.QUAY_PASSWORD }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bin/
certs/
cmd/tink-cli/tink-cli
cmd/tink-controller/tink-controller
cmd/tink-server/tink-server
cmd/tink-worker/tink-worker
Expand Down
64 changes: 0 additions & 64 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,74 +112,19 @@ This is a nonexhaustive list important packages that happen to cover most of the

The `cmd` package is home for three core binaries for Tinkerbell:

- `tink-cli` - the CLI for interacting with the `tink-server`
- `tink-server` - the tink API server
- `tink-worker` - responsible for executing the workload

```
.
├── cmd
│   ├── tink-cli
│   │   └── cmd
│   │   ├── delete
│   │   ├── get
│   │   ├── hardware
│   │   ├── template
│   │   └── workflow
│   ├── tink-server
│   └── tink-worker
│   ├── cmd
│   └── internal
```

### db

The `db` holds everything you need to deal with the database.
We use [PostgreSQL](https://www.postgresql.org/) as the data store.
The package contains database migrations, and an API to interact with database.

```
.
├── db
│   ├── migration
│   ├── mock
│   └── testdata
```

### deploy

The `deploy` directory contains all the essentials to setup Tinkerbell stack.
You can setup a local stack with `docker-compose` or Vagrant.

```
.
├── deploy
│   ├── db
│   ├── registry
│   ├── tls
│   └── vagrant
│   └── scripts
```

### grpc-server

The `grpc-server` exposes a gRPC API that connects everything together.
It has a base server that implements the API.

```
.
├── grpc-server
│   ├── grpc_server.go
│   ├── hardware.go
│   ├── hardware_test.go
│   ├── template.go
│   ├── template_test.go
│   ├── tinkerbell.go
│   ├── tinkerbell_test.go
│   ├── workflow.go
│   └── workflow_test.go
```

### protos

The `protos` package contains all the protobuf files used by the gRPC server.
Expand All @@ -189,15 +134,6 @@ CI will ensure generated files are up to date.

[buf]: https://buf.build/

```
.
├── protos
│   ├── hardware
│   ├── packet
│   ├── template
│   └── workflow
```

### environment variables

Tink Server, CLI, and Worker environment variables are documented [here](docs/ENVVARS.md).
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all: cli server worker ## Build all binaries for host OS and CPU
-include kube.mk

crosscompile: $(crossbinaries) ## Build all binaries for Linux and all supported CPU arches
images: tink-cli-image tink-server-image tink-worker-image virtual-worker-image ## Build all docker images
images: tink-server-image tink-worker-image virtual-worker-image ## Build all docker images
run: crosscompile run-stack ## Builds and runs the Tink stack (tink, db, cli) via docker-compose

test: e2etest-setup ## Run tests
Expand All @@ -18,7 +18,7 @@ verify: lint check-generated ## Verify code style, is lint free, freshness ...
$(GOFUMPT) -s -d .

generated: pbfiles protomocks generate-manifests ## Generate dynamically created files
check-generated: check-pbfiles check-protomocks ## Check if generated files are up to date
check-generated: check-pbfiles ## Check if generated files are up to date

tools: ${toolsBins} ## Build Go based build tools

Expand Down
3 changes: 0 additions & 3 deletions OWNERS.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The Tinkerbell stack consists of several microservices, and a gRPC API:

### Tink

[Tink][1] is the short-hand name for the tink-server, tink-worker, and tink-cli.
[Tink][1] is the short-hand name for the tink-server and tink-worker.
`tink-worker` and `tink-server` communicate over gRPC, and are responsible for processing workflows.
The CLI is the user-interactive piece for creating workflows and their building blocks, templates and hardware data.

Expand Down
2 changes: 1 addition & 1 deletion buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 8d7204855ec14631a499bd7393ce1970
commit: 75b4300737fb4efca0831636be94e517
4 changes: 0 additions & 4 deletions ci-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ if ! nixfmt shell.nix; then
failed=1
fi

if ! git ls-files '*.go' | xargs -I% sh -c 'sed -i "/^import (/,/^)/ { /^\s*$/ d }" % && gofumpt -w -s %'; then
failed=1
fi

if ! git diff | (! grep .); then
failed=1
fi
Expand Down
30 changes: 0 additions & 30 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package client
import (
"github.com/packethost/pkg/env"
"github.com/pkg/errors"
"github.com/tinkerbell/tink/protos/hardware"
"github.com/tinkerbell/tink/protos/template"
"github.com/tinkerbell/tink/protos/workflow"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"google.golang.org/grpc"
Expand All @@ -14,25 +12,19 @@ import (

// gRPC clients.
var (
TemplateClient template.TemplateServiceClient
WorkflowClient workflow.WorkflowServiceClient
HardwareClient hardware.HardwareServiceClient
)

// FullClient aggregates all the gRPC clients available from Tinkerbell Server.
type FullClient struct {
TemplateClient template.TemplateServiceClient
WorkflowClient workflow.WorkflowServiceClient
HardwareClient hardware.HardwareServiceClient
}

// NewFullClient returns a FullClient. A structure that contains all the
// clients made available from tink-server.
func NewFullClient(conn grpc.ClientConnInterface) *FullClient {
return &FullClient{
TemplateClient: template.NewTemplateServiceClient(conn),
WorkflowClient: workflow.NewWorkflowServiceClient(conn),
HardwareClient: hardware.NewHardwareServiceClient(conn),
}
}

Expand Down Expand Up @@ -72,30 +64,10 @@ func Setup() error {
if err != nil {
return err
}
TemplateClient = template.NewTemplateServiceClient(conn)
WorkflowClient = workflow.NewWorkflowServiceClient(conn)
HardwareClient = hardware.NewHardwareServiceClient(conn)
return nil
}

// TinkHardwareClient creates a new hardware client.
func TinkHardwareClient() (hardware.HardwareServiceClient, error) {
conn, err := GetConnection()
if err != nil {
return nil, err
}
return hardware.NewHardwareServiceClient(conn), nil
}

// TinkTemplateClient creates a new hardware client.
func TinkTemplateClient() (template.TemplateServiceClient, error) {
conn, err := GetConnection()
if err != nil {
return nil, err
}
return template.NewTemplateServiceClient(conn), nil
}

// TinkWorkflowClient creates a new workflow client.
func TinkWorkflowClient() (workflow.WorkflowServiceClient, error) {
conn, err := GetConnection()
Expand All @@ -112,8 +84,6 @@ func TinkFullClient() (FullClient, error) {
return FullClient{}, err
}
return FullClient{
HardwareClient: hardware.NewHardwareServiceClient(conn),
TemplateClient: template.NewTemplateServiceClient(conn),
WorkflowClient: workflow.NewWorkflowServiceClient(conn),
}, nil
}
2 changes: 0 additions & 2 deletions cmd/tink-cli/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions cmd/tink-cli/Dockerfile

This file was deleted.

60 changes: 0 additions & 60 deletions cmd/tink-cli/cmd/completion.go

This file was deleted.

Loading

0 comments on commit a7c40ad

Please sign in to comment.