Skip to content

Commit 50dd282

Browse files
authored
Merge pull request #1 from init4tech/swanny/builder-component
feat: builder
2 parents 8cf7a39 + 1af8e99 commit 50dd282

File tree

12 files changed

+1347
-1
lines changed

12 files changed

+1347
-1
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @rswanson

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: weekly

.github/workflows/go.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
14+
tests:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.22'
23+
24+
- name: Build
25+
run: go build -v ./...
26+
27+
- name: Run tests
28+
run: go test -v ./...

README.md

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,97 @@
1-
# signet-infra-components
1+
# Signet Infrastructure Components
2+
3+
A collection of Pulumi infrastructure components for Signet blockchain services deployed to Kubernetes.
4+
5+
## Overview
6+
7+
This repository contains reusable Pulumi components for deploying and managing Signet blockchain infrastructure. Each component is packaged as a separate Go module that can be imported into your Pulumi projects.
8+
9+
## Components
10+
11+
### Builder
12+
13+
The `builder` component deploys a Signet builder service to Kubernetes. It creates the necessary resources:
14+
15+
- Kubernetes Deployment
16+
- Kubernetes Service
17+
- Service Account
18+
- IAM Role and Policies
19+
- Prometheus monitoring
20+
21+
#### Usage
22+
23+
```go
24+
import (
25+
"github.com/your-org/signet-infra-components/builder"
26+
)
27+
28+
func main() {
29+
// Create a new builder component
30+
builderComponent, err := builder.NewBuilder(ctx, builder.BuilderComponentArgs{
31+
Namespace: "signet",
32+
Name: "signet-builder",
33+
Image: "your-registry/builder:latest",
34+
AppLabels: builder.AppLabels{
35+
Labels: pulumi.StringMap{
36+
"app": pulumi.String("builder"),
37+
},
38+
},
39+
BuilderEnv: builder.BuilderEnv{
40+
BuilderPort: pulumi.Int(8080),
41+
BuilderKey: pulumi.String("arn:aws:kms:region:account:key/keyid"),
42+
HostRpcUrl: pulumi.String("https://ethereum-rpc.example.com"),
43+
RollupRpcUrl: pulumi.String("https://rollup-rpc.example.com"),
44+
// Add other required environment variables
45+
},
46+
})
47+
if err != nil {
48+
// Handle error
49+
}
50+
51+
// Export the service URL
52+
ctx.Export("builderServiceUrl", builderComponent.GetServiceURL())
53+
}
54+
```
55+
56+
## Adding New Components
57+
58+
To add a new component:
59+
60+
1. Create a new directory with the component name
61+
2. Implement the component following the same structure as the `builder` component:
62+
- `types.go` - Define component types and interfaces
63+
- `[component].go` - Implement the main component logic
64+
- `validation.go` - Implement input validation
65+
- `helpers.go` - Add helper functions
66+
67+
## Development
68+
69+
### Prerequisites
70+
71+
- Go 1.20+
72+
- Pulumi CLI
73+
- Access to a Kubernetes cluster
74+
75+
### Testing Components
76+
77+
You can test components by creating a simple Pulumi program that uses them:
78+
79+
```go
80+
package main
81+
82+
import (
83+
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
84+
"github.com/your-org/signet-infra-components/builder"
85+
)
86+
87+
func main() {
88+
pulumi.Run(func(ctx *pulumi.Context) error {
89+
// Test your component here
90+
return nil
91+
})
92+
}
93+
```
94+
95+
## License
96+
97+
MIT License see [LICENSE](LICENSE)

go.mod

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
module github.com/init4tech/signet-infra-components
2+
3+
go 1.24.3
4+
5+
require (
6+
github.com/pulumi/pulumi-aws/sdk/v6 v6.80.0
7+
github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.23.0
8+
github.com/pulumi/pulumi/sdk/v3 v3.170.0
9+
)
10+
11+
require (
12+
dario.cat/mergo v1.0.0 // indirect
13+
github.com/BurntSushi/toml v1.2.1 // indirect
14+
github.com/Microsoft/go-winio v0.6.1 // indirect
15+
github.com/ProtonMail/go-crypto v1.1.3 // indirect
16+
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
17+
github.com/agext/levenshtein v1.2.3 // indirect
18+
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
19+
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
20+
github.com/atotto/clipboard v0.1.4 // indirect
21+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
22+
github.com/blang/semver v3.5.1+incompatible // indirect
23+
github.com/charmbracelet/bubbles v0.16.1 // indirect
24+
github.com/charmbracelet/bubbletea v0.25.0 // indirect
25+
github.com/charmbracelet/lipgloss v0.7.1 // indirect
26+
github.com/cheggaaa/pb v1.0.29 // indirect
27+
github.com/cloudflare/circl v1.3.7 // indirect
28+
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
29+
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
30+
github.com/davecgh/go-spew v1.1.1 // indirect
31+
github.com/djherbis/times v1.5.0 // indirect
32+
github.com/emirpasic/gods v1.18.1 // indirect
33+
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
34+
github.com/go-git/go-billy/v5 v5.6.1 // indirect
35+
github.com/go-git/go-git/v5 v5.13.1 // indirect
36+
github.com/gogo/protobuf v1.3.2 // indirect
37+
github.com/golang/glog v1.2.4 // indirect
38+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
39+
github.com/google/uuid v1.6.0 // indirect
40+
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
41+
github.com/hashicorp/errwrap v1.1.0 // indirect
42+
github.com/hashicorp/go-multierror v1.1.1 // indirect
43+
github.com/hashicorp/hcl/v2 v2.22.0 // indirect
44+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
45+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
46+
github.com/kevinburke/ssh_config v1.2.0 // indirect
47+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
48+
github.com/mattn/go-isatty v0.0.20 // indirect
49+
github.com/mattn/go-localereader v0.0.1 // indirect
50+
github.com/mattn/go-runewidth v0.0.15 // indirect
51+
github.com/mitchellh/go-ps v1.0.0 // indirect
52+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
53+
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
54+
github.com/muesli/cancelreader v0.2.2 // indirect
55+
github.com/muesli/reflow v0.3.0 // indirect
56+
github.com/muesli/termenv v0.15.2 // indirect
57+
github.com/opentracing/basictracer-go v1.1.0 // indirect
58+
github.com/opentracing/opentracing-go v1.2.0 // indirect
59+
github.com/pgavlin/fx v0.1.6 // indirect
60+
github.com/pjbgf/sha1cd v0.3.0 // indirect
61+
github.com/pkg/errors v0.9.1 // indirect
62+
github.com/pkg/term v1.1.0 // indirect
63+
github.com/pmezard/go-difflib v1.0.0 // indirect
64+
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
65+
github.com/pulumi/esc v0.13.0 // indirect
66+
github.com/rivo/uniseg v0.4.4 // indirect
67+
github.com/rogpeppe/go-internal v1.12.0 // indirect
68+
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
69+
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
70+
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
71+
github.com/skeema/knownhosts v1.3.0 // indirect
72+
github.com/spf13/cobra v1.8.0 // indirect
73+
github.com/spf13/pflag v1.0.5 // indirect
74+
github.com/stretchr/objx v0.5.2 // indirect
75+
github.com/stretchr/testify v1.10.0 // indirect
76+
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
77+
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
78+
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
79+
github.com/xanzy/ssh-agent v0.3.3 // indirect
80+
github.com/zclconf/go-cty v1.13.2 // indirect
81+
go.uber.org/atomic v1.9.0 // indirect
82+
golang.org/x/crypto v0.37.0 // indirect
83+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
84+
golang.org/x/mod v0.19.0 // indirect
85+
golang.org/x/net v0.39.0 // indirect
86+
golang.org/x/sync v0.13.0 // indirect
87+
golang.org/x/sys v0.32.0 // indirect
88+
golang.org/x/term v0.31.0 // indirect
89+
golang.org/x/text v0.24.0 // indirect
90+
golang.org/x/tools v0.23.0 // indirect
91+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
92+
google.golang.org/grpc v1.67.1 // indirect
93+
google.golang.org/protobuf v1.35.1 // indirect
94+
gopkg.in/warnings.v0 v0.1.2 // indirect
95+
gopkg.in/yaml.v3 v3.0.1 // indirect
96+
lukechampine.com/frand v1.4.2 // indirect
97+
)

0 commit comments

Comments
 (0)