Skip to content

Commit 4262acd

Browse files
committed
fix: added nix flake
1 parent cf451b7 commit 4262acd

6 files changed

Lines changed: 262 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
databricks-connector
22
examples/spark-java-project/target
3+
result

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
OWNER ?= pipekit
12
IMAGE_NAME ?= databricks-connector
23
TAG ?= latest
34
CLUSTER_NAME ?= k3s-default
@@ -11,8 +12,8 @@ docs:
1112

1213
.PHONY: docker-build
1314
docker-build:
14-
docker build -t isubasinghe/$(IMAGE_NAME):$(TAG) .
15-
docker push isubasinghe/databricks-connector:latest
15+
docker build -t $(OWNER)/$(IMAGE_NAME):$(TAG) .
16+
docker push $(OWNER)/databricks-connector:latest
1617

1718
.PHONY: k3d-import
1819
k3d-import:

flake.lock

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
description = "Databricks Connector for Argo Workflows";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
gomod2nix.url = "github:nix-community/gomod2nix";
8+
gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
9+
gomod2nix.inputs.flake-utils.follows = "flake-utils";
10+
};
11+
12+
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
13+
flake-utils.lib.eachDefaultSystem (system:
14+
let
15+
pkgs = nixpkgs.legacyPackages.${system};
16+
buildGoApplication = gomod2nix.legacyPackages.${system}.buildGoApplication;
17+
in
18+
{
19+
packages.default = buildGoApplication {
20+
pname = "databricks-connector";
21+
version = self.shortRev or "dirty";
22+
23+
src = ./.;
24+
25+
modules = ./gomod2nix.toml;
26+
27+
subPackages = [ "cmd/databricks-connector" ];
28+
29+
CGO_ENABLED = 0;
30+
31+
ldflags = [
32+
"-s" "-w"
33+
"-X main.version=${self.shortRev or "dirty"}"
34+
];
35+
};
36+
37+
devShells.default = pkgs.mkShell {
38+
buildInputs = with pkgs; [
39+
go
40+
gopls
41+
gotools
42+
go-tools
43+
goreleaser
44+
golangci-lint
45+
gomod2nix.packages.${system}.default
46+
];
47+
};
48+
}
49+
);
50+
}

gomod2nix.toml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
schema = 3
2+
3+
[mod]
4+
[mod."cloud.google.com/go/auth"]
5+
version = "v0.4.2"
6+
hash = "sha256-NjZehKiuO1GdgfSpC/wqGKb9vWsHcON9EIkLynVOUcY="
7+
[mod."cloud.google.com/go/auth/oauth2adapt"]
8+
version = "v0.2.2"
9+
hash = "sha256-rdgb3uWekFSfsMZeY7DqHr7Q8ELOwLIZO4W7t2Cvt40="
10+
[mod."cloud.google.com/go/compute/metadata"]
11+
version = "v0.3.0"
12+
hash = "sha256-hj2Xjlz3vj7KYONZO/ItclWGGJEUgo5EvMEkGPfQi1Q="
13+
[mod."github.com/cpuguy83/go-md2man/v2"]
14+
version = "v2.0.6"
15+
hash = "sha256-wJnHgp+NPchXkR71ARLMjo4VryzgGkz2tYWPsC+3eFo="
16+
[mod."github.com/databricks/databricks-sdk-go"]
17+
version = "v0.96.0"
18+
hash = "sha256-uCDhF52ejs6dm+jjPY4Oe3Eliq9aYbjCONylwF7sRFI="
19+
[mod."github.com/felixge/httpsnoop"]
20+
version = "v1.0.4"
21+
hash = "sha256-c1JKoRSndwwOyOxq9ddCe+8qn7mG9uRq2o/822x5O/c="
22+
[mod."github.com/go-logr/logr"]
23+
version = "v1.4.1"
24+
hash = "sha256-WM4badoqxXlBmqCRrnmtNce63dLlr/FJav3BJSYHvaY="
25+
[mod."github.com/go-logr/stdr"]
26+
version = "v1.2.2"
27+
hash = "sha256-rRweAP7XIb4egtT1f2gkz4sYOu7LDHmcJ5iNsJUd0sE="
28+
[mod."github.com/golang/groupcache"]
29+
version = "v0.0.0-20210331224755-41bb18bfe9da"
30+
hash = "sha256-7Gs7CS9gEYZkbu5P4hqPGBpeGZWC64VDwraSKFF+VR0="
31+
[mod."github.com/golang/protobuf"]
32+
version = "v1.5.4"
33+
hash = "sha256-N3+Lv9lEZjrdOWdQhFj6Y3Iap4rVLEQeI8/eFFyAMZ0="
34+
[mod."github.com/google/go-querystring"]
35+
version = "v1.1.0"
36+
hash = "sha256-itsKgKghuX26czU79cK6C2n+lc27jm5Dw1XbIRgwZJY="
37+
[mod."github.com/google/s2a-go"]
38+
version = "v0.1.7"
39+
hash = "sha256-E+SX/3VmRI5qN7SbnRP4Tt+gQTq93pScpY9U2tTmIU0="
40+
[mod."github.com/google/uuid"]
41+
version = "v1.6.0"
42+
hash = "sha256-VWl9sqUzdOuhW0KzQlv0gwwUQClYkmZwSydHG2sALYw="
43+
[mod."github.com/googleapis/enterprise-certificate-proxy"]
44+
version = "v0.3.2"
45+
hash = "sha256-wVuR3QC0mYFl5LNeKdRXdKdod7BGP5sv2h6VVib85v8="
46+
[mod."github.com/inconshreveable/mousetrap"]
47+
version = "v1.1.0"
48+
hash = "sha256-XWlYH0c8IcxAwQTnIi6WYqq44nOKUylSWxWO/vi+8pE="
49+
[mod."github.com/pkg/browser"]
50+
version = "v0.0.0-20240102092130-5ac0b6a4141c"
51+
hash = "sha256-9iaSHHpcA1fXVF5f8RlKyo1DSoHx7eGXIC2/4LFaoBY="
52+
[mod."github.com/russross/blackfriday/v2"]
53+
version = "v2.1.0"
54+
hash = "sha256-R+84l1si8az5yDqd5CYcFrTyNZ1eSYlpXKq6nFt4OTQ="
55+
[mod."github.com/spf13/cobra"]
56+
version = "v1.10.2"
57+
hash = "sha256-nbRCTFiDCC2jKK7AHi79n7urYCMP5yDZnWtNVJrDi+k="
58+
[mod."github.com/spf13/pflag"]
59+
version = "v1.0.9"
60+
hash = "sha256-YAjyYpq5BXCosVJtvYLWFG1t4gma2ylzc7ILLoj/hD8="
61+
[mod."go.opencensus.io"]
62+
version = "v0.24.0"
63+
hash = "sha256-4H+mGZgG2c9I1y0m8avF4qmt8LUKxxVsTqR8mKgP4yo="
64+
[mod."go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"]
65+
version = "v0.49.0"
66+
hash = "sha256-1/7YxtXZM4i75rXXIO6UN4CTY93nE/v2k2htS0uUOVg="
67+
[mod."go.opentelemetry.io/otel"]
68+
version = "v1.24.0"
69+
hash = "sha256-VGyV7EqJX6mRY0Ecyg+g0IZy+dt1GES4r9txQcaTNUg="
70+
[mod."go.opentelemetry.io/otel/metric"]
71+
version = "v1.24.0"
72+
hash = "sha256-KB5UQiaVmbB2VZO3al4WHb5HY79ioWaAQjaGkUKLvP8="
73+
[mod."go.opentelemetry.io/otel/trace"]
74+
version = "v1.24.0"
75+
hash = "sha256-FHP0hg+i7+wxCsM0u/5hQcgvvr3D+lq8o/7E/HkaW4s="
76+
[mod."go.yaml.in/yaml/v3"]
77+
version = "v3.0.4"
78+
hash = "sha256-NkGFiDPoCxbr3LFsI6OCygjjkY0rdmg5ggvVVwpyDQ4="
79+
[mod."golang.org/x/crypto"]
80+
version = "v0.47.0"
81+
hash = "sha256-78iRvMmPZVTBrIk30yGpAO11kVC5TLR1zGW85gFLHk4="
82+
[mod."golang.org/x/exp"]
83+
version = "v0.0.0-20240222234643-814bf88cf225"
84+
hash = "sha256-DM6/KUjyqyuqXai7UH1vMsoKXQAlYfcHTwK1dHqjRAc="
85+
[mod."golang.org/x/mod"]
86+
version = "v0.31.0"
87+
hash = "sha256-ZVNmaZADgM3+30q9rW8q4gP6ySkT7r1eb4vrHIlpCjM="
88+
[mod."golang.org/x/net"]
89+
version = "v0.49.0"
90+
hash = "sha256-arK6PWwO9tQUJVb57QXUEXfgcB6ISI6qjVB0eC4zcnw="
91+
[mod."golang.org/x/oauth2"]
92+
version = "v0.34.0"
93+
hash = "sha256-5eqpGGxJ7FJsPmfRek6roeGmkWHBMJaWYXyz8gXJsS4="
94+
[mod."golang.org/x/sys"]
95+
version = "v0.40.0"
96+
hash = "sha256-KDe+wMr7dfMFwKMJEljzk+f82pQWFFPoFHivjD7qJGg="
97+
[mod."golang.org/x/text"]
98+
version = "v0.33.0"
99+
hash = "sha256-XdA6D39ESuJkaaM/SRBnqZzjKUwi6Gbt1Si1nvauTr4="
100+
[mod."golang.org/x/time"]
101+
version = "v0.5.0"
102+
hash = "sha256-W6RgwgdYTO3byIPOFxrP2IpAZdgaGowAaVfYby7AULU="
103+
[mod."google.golang.org/api"]
104+
version = "v0.182.0"
105+
hash = "sha256-fSWYDcOucHlL6xisSrb9GfXmkpoCUxaRESHLVjKOiyI="
106+
[mod."google.golang.org/genproto/googleapis/rpc"]
107+
version = "v0.0.0-20240521202816-d264139d666e"
108+
hash = "sha256-hQjIHJdIBBAthdXMB19Xr3A2Wy6GV6Gjv4w4MZl7qy4="
109+
[mod."google.golang.org/grpc"]
110+
version = "v1.64.1"
111+
hash = "sha256-A1+kiePmeqRIdigryUGNJWZiILLacDPtMTEyO6CqDpY="
112+
[mod."google.golang.org/protobuf"]
113+
version = "v1.34.1"
114+
hash = "sha256-qnHqY6KLZiZDbTVTN6uzF4jedxROYlPCYHoiv6XI0sc="
115+
[mod."gopkg.in/ini.v1"]
116+
version = "v1.67.0"
117+
hash = "sha256-V10ahGNGT+NLRdKUyRg1dos5RxLBXBk1xutcnquc/+4="

manifests/workflow-template.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ spec:
278278
- name: email-notifications
279279
- name: databricks-secret-name
280280
container:
281-
image: isubasinghe/databricks-connector:latest
281+
image: ghcr.io/pipekit/databricks-connector:v0.0.1
282282
command: ["/databricks-connector", "submit"]
283283
args:
284284
- "--code-path={{inputs.parameters.code-path}}"
@@ -328,7 +328,7 @@ spec:
328328
- name: job-parameters
329329
- name: databricks-secret-name
330330
container:
331-
image: isubasinghe/databricks-connector:latest
331+
image: ghcr.io/pipekit/databricks-connector:v0.0.1
332332
command: ["/databricks-connector", "start"]
333333
args:
334334
- "--job-id={{inputs.parameters.job-id}}"
@@ -358,7 +358,7 @@ spec:
358358
- name: run-id
359359
- name: databricks-secret-name
360360
container:
361-
image: isubasinghe/databricks-connector:latest
361+
image: ghcr.io/pipekit/databricks-connector:v0.0.1
362362
command: ["/databricks-connector", "monitor"]
363363
args:
364364
- "--run-id={{inputs.parameters.run-id}}"
@@ -399,7 +399,7 @@ spec:
399399
valueFrom:
400400
path: /tmp/json
401401
container:
402-
image: isubasinghe/databricks-connector:latest
402+
image: ghcr.io/pipekit/databricks-connector:v0.0.1
403403
command: ["/databricks-connector", "get-output"]
404404
args:
405405
- "--run-id={{inputs.parameters.run-id}}"
@@ -429,7 +429,7 @@ spec:
429429
- name: run-id
430430
- name: databricks-secret-name
431431
container:
432-
image: isubasinghe/databricks-connector:latest
432+
image: ghcr.io/pipekit/databricks-connector:v0.0.1
433433
command: ["/databricks-connector", "cancel"]
434434
args:
435435
- "--run-id={{inputs.parameters.run-id}}"
@@ -447,4 +447,4 @@ spec:
447447
resources:
448448
requests:
449449
cpu: 50m
450-
memory: 64Mi
450+
memory: 64Mi

0 commit comments

Comments
 (0)