Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifacts bring admin monorepo #4203

Merged
merged 52 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
9e8ba87
untested, event printing mostly in
wild-endeavor Jun 1, 2023
772dda2
added printing of usage and saving in execution spec metadata
wild-endeavor Jun 2, 2023
8636731
compiling
wild-endeavor Jul 19, 2023
f53ed6e
merge master
wild-endeavor Jul 20, 2023
c208b12
rename events, only transform on succeeded, background context, recei…
wild-endeavor Jul 24, 2023
43cc5d8
marshal by json instead of bytes, remove helper function, add new key…
wild-endeavor Jul 25, 2023
878cbcc
remove code that used to handle creation of artifact events
wild-endeavor Jul 25, 2023
6b99adb
parameter and literal map construction wrong
wild-endeavor Aug 1, 2023
2c2ff30
add port, add nil checks
wild-endeavor Aug 1, 2023
8c67a4e
compiling
wild-endeavor Aug 9, 2023
cf2fd0e
added some fields
wild-endeavor Aug 9, 2023
85243b4
some manual templating
wild-endeavor Aug 10, 2023
a2c074e
remove the external artifact eventing, add better execution hack
wild-endeavor Aug 10, 2023
4240096
Remove artifactid from literal (#6)
wild-endeavor Sep 4, 2023
a2d4735
Emit event for execution time lineage (#8)
wild-endeavor Sep 5, 2023
462343a
Add workflow and task sending (#9)
wild-endeavor Sep 7, 2023
cff0609
check if request.Inputs is nil (#10)
pingsutw Sep 8, 2023
35b5c81
Pass Trigger launch plans to Artifact service (#11)
wild-endeavor Sep 16, 2023
52e4f5f
fix demo code, not needed but for cleanliness (#13)
wild-endeavor Sep 19, 2023
b721be4
Debug sandbox (#14)
wild-endeavor Sep 26, 2023
68fd7a6
merge artifacts branch from b485d57f552de9b47f3e6c13277d39e535b3295e
wild-endeavor Oct 11, 2023
887ae90
Artifacts bundle (#7)
wild-endeavor Sep 26, 2023
efdcb1d
Remove private repos (#4078)
wild-endeavor Sep 26, 2023
5f22ad5
add service dummy
wild-endeavor Sep 29, 2023
9e9de62
remove binary
wild-endeavor Sep 29, 2023
fa997eb
in the middle of changes, merging to let eduardo merge
wild-endeavor Oct 4, 2023
3f88f17
add default config file itself into search path
wild-endeavor Oct 11, 2023
4f044e0
adding common shared service things and starting to use them in artif…
wild-endeavor Oct 11, 2023
6d1dc5a
remove agent yaml
wild-endeavor Oct 11, 2023
e030e55
Merge remote-tracking branch 'origin/artifacts' into artifacts-bring-…
wild-endeavor Oct 11, 2023
3e35e61
update to use label value
wild-endeavor Oct 12, 2023
17ea904
This brings in the incomplete WIP changes to add a golang version of the
wild-endeavor Oct 12, 2023
f04aa07
add search endpoint for listing, add grpc hooks
wild-endeavor Oct 12, 2023
651aa2a
halfway through adding database stuff
wild-endeavor Oct 12, 2023
c69cc81
switch
wild-endeavor Oct 13, 2023
72d9c47
middle of debugging create db
wild-endeavor Oct 13, 2023
e830db5
migration ran
wild-endeavor Oct 15, 2023
644d2d1
saving changes
wild-endeavor Oct 16, 2023
2cfde13
go mod tidy
eapolinario Oct 16, 2023
b2bd8e4
Build flyteartifacts in CI
eapolinario Oct 16, 2023
6f61c14
Push tag for flyteartifacts module on merges to master
eapolinario Oct 16, 2023
cc03ed9
Run checks on changes to flyteartifacts
eapolinario Oct 16, 2023
128495e
make -C flyteidl generate
eapolinario Oct 16, 2023
067d0d2
More linting
eapolinario Oct 16, 2023
a7605e4
debugging hstore
wild-endeavor Oct 17, 2023
f718e6c
merge branch and re generate idl
wild-endeavor Oct 17, 2023
4674a08
add start of boilerplate for single binary, renamed the cloud event c…
wild-endeavor Oct 18, 2023
5c659aa
Use pgx to create Hstore values
eapolinario Oct 18, 2023
729b300
[wip] artf/impl create get (#4258)
wild-endeavor Oct 20, 2023
ceb390d
Artifact/event processing (#4277)
wild-endeavor Oct 27, 2023
bdddc93
Artifact - Remove redis channel (#4320)
wild-endeavor Oct 28, 2023
23d5fc2
couple small items
wild-endeavor Oct 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/bump-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
const components = [
"datacatalog",
"flyteadmin",
"flyteartifacts",
"flytecopilot",
"flyteidl",
"flyteplugins",
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- 'datacatalog/**'
- 'flyteadmin/**'
- 'flyteartifacts/**'
- 'flytecopilot/**'
- 'flyteplugins/**'
- 'flytepropeller/**'
Expand All @@ -15,6 +16,7 @@ on:
paths:
- 'datacatalog/**'
- 'flyteadmin/**'
- 'flyteartifacts/**'
- 'flytecopilot/**'
- 'flyteidl/**'
- 'flyteplugins/**'
Expand Down Expand Up @@ -80,6 +82,7 @@ jobs:
component:
- datacatalog
- flyteadmin
- flyteartifacts
- flytecopilot
- flytepropeller
name: Docker Build Images
Expand Down Expand Up @@ -162,6 +165,7 @@ jobs:
component:
- datacatalog
- flyteadmin
- flyteartifacts
- flytecopilot
- flytepropeller
- flytescheduler
Expand Down
42 changes: 42 additions & 0 deletions Dockerfile.flyteartifacts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM --platform=${BUILDPLATFORM} golang:1.19-alpine3.16 as builder

ARG TARGETARCH
ENV GOARCH "${TARGETARCH}"
ENV GOOS linux

RUN apk add git openssh-client make curl

# Create the artifacts directory
RUN mkdir /artifacts

WORKDIR /go/src/github.com/flyteorg/flyte/flyteartifacts/

COPY datacatalog ../datacatalog
COPY flyteadmin ../flyteadmin
COPY flyteartifacts .
COPY flytecopilot ../flytecopilot
COPY flyteidl ../flyteidl
COPY flyteplugins ../flyteplugins
COPY flytepropeller ../flytepropeller
COPY flytestdlib ../flytestdlib

# This 'linux_compile' target should compile binaries to the /artifacts directory
# The main entrypoint should be compiled to /artifacts/flyteadmin
RUN make linux_compile

# update the PATH to include the /artifacts directory
ENV PATH="/artifacts:${PATH}"

# This will eventually move to centurylink/ca-certs:latest for minimum possible image size
FROM alpine:3.16
LABEL org.opencontainers.image.source https://github.com/flyteorg/flyte/

COPY --from=builder /artifacts /bin

# Ensure the latest CA certs are present to authenticate SSL connections.
RUN apk --update add ca-certificates

RUN addgroup -S flyte && adduser -S flyte -G flyte
USER flyte

CMD ["artifacts"]
7 changes: 2 additions & 5 deletions charts/flyte-sandbox/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.1.9
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 17.15.6
digest: sha256:1bcc5f102768a19c19d444b3460dabd0f90847b2d4423134f0ce9c7aa0a256ea
generated: "2023-08-31T16:46:00.478623-07:00"
digest: sha256:e7155e540bbdb98f690eb12e2bd301a19d8b36833336f6991410cb44d8d9bb5e
generated: "2023-10-28T10:05:34.269916+08:00"
4 changes: 0 additions & 4 deletions charts/flyte-sandbox/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,3 @@ dependencies:
version: 12.1.9
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
- name: redis
version: 17.15.6
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled
23 changes: 3 additions & 20 deletions charts/flyte-sandbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ flyte-binary:
memory: 0
cloudEvents:
enable: true
transformToCloudEvents: true
type: redis
redis:
addr: "flyte-sandbox-redis-headless.flyte.svc.cluster.local:6379"
cloudEventVersion: v2
type: sandbox
artifacts:
host: artifact-service.flyte.svc.cluster.local
host: localhost
port: 50051
insecure: true
storage:
Expand Down Expand Up @@ -159,21 +157,6 @@ postgresql:
tag: sandbox
pullPolicy: Never

redis:
enabled: true
image:
tag: sandbox
pullPolicy: Never
auth:
enabled: false
master:
service:
type: NodePort
nodePorts:
redis: 30004
replica:
replicaCount: 0

sandbox:
# dev Routes requests to an instance of Flyte running locally on a developer's
# development environment. This is only usable if the flyte-binary chart is disabled.
Expand Down
5 changes: 5 additions & 0 deletions cmd/single/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ type Config struct {
Propeller Propeller `json:"propeller" pflag:",Configuration to disable propeller or any of its components."`
Admin Admin `json:"admin" pflag:",Configuration to disable FlyteAdmin or any of its components"`
DataCatalog DataCatalog `json:"dataCatalog" pflag:",Configuration to disable DataCatalog or any of its components"`
Artifact Artifacts `json:"artifact" pflag:",Configuration to disable Artifact or any of its components"`
}

type Propeller struct {
Disabled bool `json:"disabled" pflag:",Disables flytepropeller in the single binary mode"`
DisableWebhook bool `json:"disableWebhook" pflag:",Disables webhook only"`
}

type Artifacts struct {
Disabled bool `json:"disabled" pflag:",Disables flyteartifacts in the single binary mode"`
}

type Admin struct {
Disabled bool `json:"disabled" pflag:",Disables flyteadmin in the single binary mode"`
DisableScheduler bool `json:"disableScheduler" pflag:",Disables Native scheduler in the single binary mode"`
Expand Down
48 changes: 48 additions & 0 deletions cmd/single/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package single

import (
"context"
sharedCmd "github.com/flyteorg/flyte/flyteartifacts/cmd/shared"
"github.com/flyteorg/flyte/flyteartifacts/pkg/configuration"
artifactsServer "github.com/flyteorg/flyte/flyteartifacts/pkg/server"
"github.com/flyteorg/flyte/flytestdlib/database"
"net/http"

datacatalogConfig "github.com/flyteorg/flyte/datacatalog/pkg/config"
Expand Down Expand Up @@ -59,6 +63,40 @@ func startClusterResourceController(ctx context.Context) error {
return nil
}

func startArtifact(ctx context.Context, cfg Artifacts) error {
if cfg.Disabled {
logger.Infof(ctx, "Artifacts server is disabled. Skipping...")
return nil
}
// Roughly copies main/NewMigrateCmd
logger.Infof(ctx, "Artifacts: running database migrations if any...")
migs := artifactsServer.GetMigrations(ctx)
initializationSql := "create extension if not exists hstore;"
dbConfig := artifactsServer.GetDbConfig()
err := database.Migrate(context.Background(), dbConfig, migs, initializationSql)
if err != nil {
logger.Errorf(ctx, "Failed to run Artifacts database migrations. Error: %v", err)
return err
}

g, childCtx := errgroup.WithContext(ctx)

// Rough copy of NewServeCmd
g.Go(func() error {
cfg := configuration.GetApplicationConfig()
serverCfg := &cfg.ArtifactServerConfig
err := sharedCmd.ServeGateway(childCtx, "artifacts", serverCfg, artifactsServer.GrpcRegistrationHook,
artifactsServer.HttpRegistrationHook)
if err != nil {
logger.Errorf(childCtx, "Failed to start Artifacts server. Error: %v", err)
return err
}
return nil
})

return g.Wait()
}

func startAdmin(ctx context.Context, cfg Admin) error {
logger.Infof(ctx, "Running Database Migrations...")
if err := adminServer.Migrate(ctx); err != nil {
Expand Down Expand Up @@ -192,6 +230,16 @@ var startCmd = &cobra.Command{
})
}

if !cfg.Artifact.Disabled {
g.Go(func() error {
err := startArtifact(childCtx, cfg.Artifact)
if err != nil {
logger.Panicf(childCtx, "Failed to start Artifacts server, err: %v", err)
}
return nil
})
}

if !cfg.Propeller.Disabled {
g.Go(func() error {
err := startPropeller(childCtx, cfg.Propeller)
Expand Down
26 changes: 13 additions & 13 deletions datacatalog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ require (
github.com/gofrs/uuid v4.2.0+incompatible
github.com/golang/glog v1.1.0
github.com/golang/protobuf v1.5.3
github.com/jackc/pgconn v1.10.1
github.com/jackc/pgconn v1.14.1
github.com/mitchellh/mapstructure v1.5.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
google.golang.org/grpc v1.56.1
gorm.io/driver/postgres v1.2.3
gorm.io/driver/sqlite v1.1.1
gorm.io/gorm v1.22.4
gorm.io/driver/postgres v1.5.3
gorm.io/driver/sqlite v1.5.4
gorm.io/gorm v1.25.4
)

require (
Expand Down Expand Up @@ -46,6 +46,7 @@ require (
github.com/flyteorg/stow v0.3.7 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-gormigrate/gormigrate/v2 v2.1.1 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand All @@ -58,17 +59,16 @@ require (
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.2.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.9.0 // indirect
github.com/jackc/pgx/v4 v4.14.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.4.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.4 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-sqlite3 v1.14.0 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/ncw/swift v1.0.53 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
Expand All @@ -87,10 +87,10 @@ require (
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.1.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
Expand Down
Loading
Loading