From 58ebbdf3058f64934bc06fc88539f3a9b2635add Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Fri, 2 Dec 2022 18:39:32 -0800 Subject: [PATCH 01/37] move things to stdlib Signed-off-by: Yee Hing Tong --- go.mod | 24 +-- go.sum | 261 +++++++++++------------------- pkg/repositories/database.go | 106 +----------- pkg/repositories/database_test.go | 150 +---------------- 4 files changed, 120 insertions(+), 421 deletions(-) diff --git a/go.mod b/go.mod index b42085d07..6e1231316 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 - github.com/jackc/pgconn v1.10.1 + github.com/jackc/pgconn v1.13.0 github.com/lestrrat-go/jwx v1.1.6 github.com/magiconair/properties v1.8.6 github.com/mitchellh/mapstructure v1.4.3 @@ -45,16 +45,16 @@ require ( github.com/sendgrid/sendgrid-go v3.10.0+incompatible github.com/spf13/cobra v1.4.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.7.2 + github.com/stretchr/testify v1.8.0 golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 google.golang.org/api v0.76.0 google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46 google.golang.org/grpc v1.46.0 google.golang.org/protobuf v1.28.0 - gorm.io/driver/postgres v1.2.3 + gorm.io/driver/postgres v1.4.5 gorm.io/driver/sqlite v1.1.1 - gorm.io/gorm v1.22.4 + gorm.io/gorm v1.24.1-0.20221019064659-5dd2bb482755 k8s.io/api v0.24.1 k8s.io/apimachinery v0.24.1 k8s.io/client-go v0.24.1 @@ -101,6 +101,7 @@ require ( github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.5 // indirect github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/go-test/deep v1.0.7 // indirect github.com/goccy/go-json v0.4.8 // indirect github.com/gofrs/uuid v4.2.0+incompatible // indirect @@ -118,13 +119,13 @@ 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/pgproto3/v2 v2.3.1 // 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/pgtype v1.12.0 // indirect + github.com/jackc/pgx/v4 v4.17.2 // indirect github.com/jcmturner/gofork v1.0.0 // 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/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -163,10 +164,10 @@ require ( github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/viper v1.11.0 // indirect - github.com/stretchr/objx v0.3.0 // indirect + github.com/stretchr/objx v0.4.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect @@ -185,6 +186,7 @@ require ( gopkg.in/square/go-jose.v2 v2.5.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gorm.io/driver/mysql v1.4.4 // indirect k8s.io/apiextensions-apiserver v0.24.1 // indirect sigs.k8s.io/json v0.0.0-20220525155127-227cbc7cc124 // indirect sigs.k8s.io/yaml v1.3.0 // indirect @@ -208,3 +210,5 @@ require ( ) replace github.com/robfig/cron/v3 => github.com/unionai/cron/v3 v3.0.2-0.20210825070134-bfc34418fe84 + +replace github.com/flyteorg/flytestdlib => ../flytestdlib diff --git a/go.sum b/go.sum index 4bd8bb2f9..c5fdfa2fb 100644 --- a/go.sum +++ b/go.sum @@ -17,7 +17,6 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= @@ -51,6 +50,7 @@ cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLq cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= @@ -68,66 +68,56 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.0 h1:NUV0NNp9nkBuW66BFRLuMgldN60C57ET3dhbwLIYio8= cloud.google.com/go/storage v1.22.0/go.mod h1:GbaLEoMqbVm6sx3Z0R++gSiBlgMv6yUi2q1DeGFKQgE= contrib.go.opencensus.io/exporter/stackdriver v0.13.1/go.mod h1:z2tyTZtPmQ2HvWH4cOmVDgtY+1lomfKdbLnkJvZdc8c= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v62.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v63.4.0+incompatible h1:fle3M5Q7vr8auaiPffKyUQmLbvYeqpw30bKU6PrWJFo= github.com/Azure/azure-sdk-for-go v63.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.1 h1:3CVsSo4mp8NDWO11tHzN/mdo2zP0CtaSK5IcwBjfqRA= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.1/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2 h1:Px2KVERcYEg2Lv25AqC2hVr0xUWaq94wuEObLIkYzmA= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.2/go.mod h1:CdSJQNNzZhCkwDaV27XV1w48ZBPtxe7mlrZAsPNxD5g= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.0 h1:0nJeKDmB7a1a8RDMjTltahlPsaNlWjq/LpkZleSwINk= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.0/go.mod h1:mbwxKc/fW+IkF0GG591MuXw0KuEQBDkeRoZ9vmVJPxg= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest v0.11.17/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest v0.11.27 h1:F3R3q42aWytozkV8ihzcgMO4OA4cuqr3bNlsEuF6//A= github.com/Azure/go-autorest/autorest v0.11.27/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.10/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v3.4.1+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.0.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/opencensus-go-exporter-datadog v0.0.0-20191210083620-6965a1cfed68/go.mod h1:gMGUEe16aZh0QN941HgDjwrdjU4iTthPoz2/AtDRADE= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= @@ -156,8 +146,6 @@ github.com/Shopify/sarama v1.26.4 h1:+17TxUq/PJEAfZAll0T7XJjSgQWCpaQSoki/x5yN8o8 github.com/Shopify/sarama v1.26.4/go.mod h1:NbSGBSSndYaIhRcBtY9V0U7AyH+x71bG668AuWys/yU= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -168,29 +156,22 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.23.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.3/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.37.1/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.2 h1:5VBk5r06bgxgRKVaUtm1/4NT/rtrnH2E4cnAYv5zgQc= github.com/aws/aws-sdk-go v1.44.2/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= @@ -208,7 +189,6 @@ github.com/bmatcuk/doublestar/v2 v2.0.3/go.mod h1:QMmcs3H2AUQICWhfzLXz+IYln8lRQm github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737 h1:rRISKWyXfVxvoa702s91Zl5oREZTrR3yv+tXrrX7G/g= github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= @@ -226,7 +206,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.8.0 h1:hRguaVL9rVsO8PMOpKSZ5gYZ2kjGRCvuKw4yMlfsBtg= github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.8.0/go.mod h1:Ba4CS2d+naAK8tGd6nm5ftGIWuHim+1lryAaIxhuh1k= @@ -248,7 +229,6 @@ github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMe github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= github.com/cockroachdb/cockroach-go v0.0.0-20190925194419-606b3d062051/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= github.com/cockroachdb/cockroach-go v0.0.0-20200312223839-f565e4789405/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= @@ -268,14 +248,11 @@ github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjs github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -300,9 +277,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -318,7 +294,6 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8 github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -344,7 +319,6 @@ github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= @@ -358,10 +332,6 @@ github.com/flyteorg/flyteplugins v1.0.18 h1:DOyxAFaS4luv7H9XRKUpHbO09imsG4LP8Du5 github.com/flyteorg/flyteplugins v1.0.18/go.mod h1:ZbZVBxEWh8Icj1AgfNKg0uPzHHGd9twa4eWcY2Yt6xE= github.com/flyteorg/flytepropeller v1.1.47 h1:k+moR+YGOyKJnYHDZjBBXvwnuZJ7IhK/PRv/9Ak/QIs= github.com/flyteorg/flytepropeller v1.1.47/go.mod h1:vZlQTBOsddrNGxmA0To+B2ld3VFg6sRWwcC4KU7+g9A= -github.com/flyteorg/flytestdlib v1.0.0/go.mod h1:QSVN5wIM1lM9d60eAEbX7NwweQXW96t5x4jbyftn89c= -github.com/flyteorg/flytestdlib v1.0.12 h1:A+yN5TX/SezjCjzv/JV29SzlBAyKGeLDOfAiYqzrKcw= -github.com/flyteorg/flytestdlib v1.0.12/go.mod h1:nIBmBHtjTJvhZEn3e/EwVC/iMkR2tUX8hEiXjRBpH/s= -github.com/flyteorg/stow v0.3.3/go.mod h1:HBld7ud0i4khMHwJjkO8v+NSP7ddKa/ruhf4I8fliaA= github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk= github.com/flyteorg/stow v0.3.6/go.mod h1:5dfBitPM004dwaZdoVylVjxFT4GWAgI0ghAndhNUzCo= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -370,8 +340,6 @@ github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE= @@ -393,7 +361,6 @@ github.com/go-gormigrate/gormigrate/v2 v2.0.0 h1:e2A3Uznk4viUC4UuemuVgsNnvYZyOA8 github.com/go-gormigrate/gormigrate/v2 v2.0.0/go.mod h1:YuVJ+D/dNt4HWrThTBnjgZuRbt7AuwINeg4q52ZE3Jw= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -421,8 +388,10 @@ github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5F github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= @@ -672,6 +641,7 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= @@ -684,7 +654,6 @@ github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2/go.mod h1:xEhNfoBDX1hz github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -765,7 +734,6 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -809,7 +777,6 @@ github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyC github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.1.2/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= github.com/gorilla/sessions v1.1.3/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -817,7 +784,6 @@ github.com/gotestyourself/gotestyourself v1.3.0/go.mod h1:zZKM6oeNM8k+FRljX1mnzV github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -825,28 +791,36 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 h1:7xsUJsB2NrdcttQPa7JLEaGzvdbk7KvfrjgHZXOQRo0= github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69/go.mod h1:YLEMZOtU+AZ7dhN9T/IpGhXVGly2bvkJQ+zxj3WeVQo= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -856,10 +830,13 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -867,7 +844,6 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= @@ -884,8 +860,8 @@ github.com/jackc/pgconn v1.6.4/go.mod h1:w2pne1C2tZgP+TvjqLpOigGzNqjBgQW9dUw/4Ch github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.10.1 h1:DzdIHIjG1AxGwoEEqS+mGsURyjt4enSmqzACXvVzOT8= -github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys= +github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= @@ -903,8 +879,8 @@ github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwX github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.2.0 h1:r7JypeP2D3onoQTCxWdTpCtJ4D+qpKr0TxvoyMhZ5ns= -github.com/jackc/pgproto3/v2 v2.2.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y= +github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= @@ -916,8 +892,8 @@ github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkAL github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= github.com/jackc/pgtype v1.4.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.9.0 h1:/SH1RxEtltvJgsDqp3TbiTFApD3mey3iygpuEGeuBXk= -github.com/jackc/pgtype v1.9.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w= +github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= @@ -929,14 +905,14 @@ github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6 github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= github.com/jackc/pgx/v4 v4.8.1/go.mod h1:4HOLxrl8wToZJReD04/yB20GDwf4KBYETvlHciCnwW0= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.14.0 h1:TgdrmgnM7VY72EuSQzBbBd4JA1RLqJolrw9nQVZABVc= -github.com/jackc/pgx/v4 v4.14.0/go.mod h1:jT3ibf/A0ZVCp89rtCIN0zCJxcE74ypROmHEZYsG/j8= +github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E= +github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= @@ -946,10 +922,9 @@ github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.4 h1:tHnRBy1i5F2Dh8BAFxqFzxKqqvezXrL2OW1TnX+Mlas= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -968,8 +943,7 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -1005,9 +979,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= @@ -1016,6 +989,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lestrrat-go/backoff/v2 v2.0.7 h1:i2SeK33aOFJlUNJZzf2IpXRBvqBBnaGXfY5Xaop/GsE= github.com/lestrrat-go/backoff/v2 v2.0.7/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= github.com/lestrrat-go/codegen v1.0.0/go.mod h1:JhJw6OQAuPEfVKUCLItpaVLumDGWQznd1VaXrBk9TdM= @@ -1038,14 +1012,11 @@ github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/luna-duclos/instrumentedsql v0.0.0-20181127104832-b7d587d28109/go.mod h1:PWUIzhtavmOR965zfawVsHXbEuU1G29BPZ/CB3C7jXk= github.com/luna-duclos/instrumentedsql v1.1.2/go.mod h1:4LGbEqDnopzNAiyxPPDXhLspyunZxgPTMJBKtC6U0BQ= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -1078,7 +1049,6 @@ github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcncea github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -1088,11 +1058,11 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -1108,7 +1078,10 @@ github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182aff github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -1135,6 +1108,7 @@ github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3P github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/monoculum/formam v0.0.0-20180901015400-4e68be1d79ba/go.mod h1:RKgILGEJq24YyJ2ban8EO0RUVSJlF1pGsEvoLEACr/Q= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/moul/http2curl v0.0.0-20170919181001-9ac6cf4d929b/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= @@ -1142,27 +1116,17 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/ncw/swift v1.0.49/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/ncw/swift v1.0.53 h1:luHjjTNtekIEvHg5KdAFIBaH7bWfNkefwFnpDffSIks= github.com/ncw/swift v1.0.53/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oleiade/reflections v1.0.0 h1:0ir4pc6v8/PJ0yw5AEtMddfXpWBXg9cnG7SgSoJuCgY= github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1184,18 +1148,15 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.1-0.20190913142402-a7454ce5950e/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/analytics-go/v4 v4.0.0/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE= @@ -1224,25 +1185,22 @@ github.com/ory/x v0.0.93/go.mod h1:lfcTaGXpTZs7IEQAW00r9EtTCOxD//SiP5uWtNiz31g= github.com/ory/x v0.0.110/go.mod h1:DJfkE3GdakhshNhw4zlKoRaL/ozg/lcTahA9OCih2BE= github.com/ory/x v0.0.162 h1:xE/UBmmMlInTvlgGXUyo+VeZAcWU5gyWb/xh6jmBWsI= github.com/ory/x v0.0.162/go.mod h1:sj3z/MeCrAyNFFTfN6yK1nTmHXGSFnw+QwIIQ/Rowec= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= @@ -1255,53 +1213,45 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.10.0/go.mod h1:NxmoDg/QLVWluQDUYG7XBZTLUpKeFa8e3aMf1BfjyHk= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pkg/sftp v1.13.4/go.mod h1:LzqnAvaD5TWeNBsZpfKxSYn1MbjWwOsCIAFFJbpIsK8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 h1:0XM1XL/OFFJjXsYXlG30spTkV/E9+gmd5GD1w2HE8xM= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/pquerna/ffjson v0.0.0-20190813045741-dac163c6c0a9/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= +github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v0.9.4/go.mod h1:oCXIBxdI62A4cR6aTRJCgetEjecSIYzOEaeAn4iYEpM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= @@ -1329,7 +1279,7 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= github.com/santhosh-tekuri/jsonschema/v2 v2.1.0/go.mod h1:yzJzKUGV4RbWqWIBBP4wSOBqavX5saE02yirLS0OTyg= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= @@ -1377,7 +1327,6 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:X github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= @@ -1386,7 +1335,6 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.2/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= @@ -1400,7 +1348,6 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v0.0.7/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= @@ -1409,7 +1356,6 @@ github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmq github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -1419,19 +1365,16 @@ github.com/spf13/viper v1.3.1/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1439,8 +1382,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.1.1/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -1449,9 +1392,9 @@ github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0 github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= @@ -1463,8 +1406,6 @@ github.com/unionai/cron/v3 v3.0.2-0.20210825070134-bfc34418fe84 h1:EompdlTtH1Gbc github.com/unionai/cron/v3 v3.0.2-0.20210825070134-bfc34418fe84/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/unrolled/secure v0.0.0-20180918153822-f340ee86eb8b/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA= github.com/unrolled/secure v0.0.0-20181005190816-ff9db2ff917f/go.mod h1:mnPT77IAdsi/kV7+Es7y+pXALeV3h7G6dQF6mNYjcLA= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -1481,6 +1422,7 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.elastic.co/apm v1.8.0/go.mod h1:tCw6CkOJgkWnzEthFN9HUP1uL3Gjc/Ur6m7gRPLaoH0= @@ -1488,21 +1430,20 @@ go.elastic.co/apm/module/apmhttp v1.8.0/go.mod h1:9LPFlEON51/lRbnWDfqAWErihIiAFD go.elastic.co/apm/module/apmot v1.8.0/go.mod h1:Q5Xzabte8G/fkvDjr1jlDuOSUt9hkVWNZEHh6ZNaTjI= go.elastic.co/fastjson v1.0.0/go.mod h1:PmeUOMMtLHQr9ZS9J9owrAVg0FkaZDRZJEFTTGHtchs= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= @@ -1510,7 +1451,6 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.22.6/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= @@ -1579,6 +1519,7 @@ golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1588,6 +1529,7 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -1597,8 +1539,10 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1643,6 +1587,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180816102801-aaf60122140d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1661,7 +1606,6 @@ golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181207154023-610586996380/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1693,7 +1637,6 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1705,10 +1648,10 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1716,6 +1659,7 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1735,6 +1679,7 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= @@ -1772,7 +1717,6 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181106135930-3a76605856fd/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1793,14 +1737,16 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191105231009-c1f44814a5cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1824,19 +1770,18 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1856,6 +1801,7 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1866,6 +1812,9 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1882,7 +1831,6 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1894,7 +1842,6 @@ golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0k golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181003024731-2f84ea8ef872/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181006002542-f60d9635b16a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1940,6 +1887,7 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190711191110-9a621aea19f8/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1982,9 +1930,7 @@ golang.org/x/tools v0.0.0-20200721223218-6123e77877b2/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -2000,7 +1946,6 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2019,7 +1964,6 @@ gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6d gonum.org/v1/netlib v0.0.0-20191229114700-bbb4dff026f8/go.mod h1:2IgXn/sJaRbePPBA1wRj8OE+QLvVaH0q8SK6TSTKlnk= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.0.0-20200111075622-4abb28f724d5/go.mod h1:+HbaZVpsa73UwN7kXGCECULRHovLRJjH+t5cFPgxErs= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -2038,8 +1982,6 @@ google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= -google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.38.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= @@ -2054,6 +1996,7 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6 google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= @@ -2078,7 +2021,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190708153700-3bdd9d9f5532/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -2108,10 +2050,7 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201102152239-715cce707fb0/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -2144,6 +2083,8 @@ google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= @@ -2164,7 +2105,6 @@ google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46 h1:G1IeWbjrqEq9ChWxEuRPJu6laA67+XgTFHVSAvepr38= google.golang.org/genproto v0.0.0-20220426171045-31bebdecfb46/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -2183,7 +2123,6 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= @@ -2225,13 +2164,10 @@ gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/mold.v2 v2.2.0/go.mod h1:XMyyRsGtakkDPbxXbrA5VODo6bUXyvoDjLd5l3T0XoA= @@ -2243,7 +2179,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= @@ -2257,7 +2192,7 @@ gopkg.in/jcmturner/gokrb5.v7 v7.5.0 h1:a9tsXlIDD9SKxotJMK3niV7rPZAJeX2aD/0yg3qlI gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU= gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= -gopkg.in/kothar/go-backblaze.v0 v0.0.0-20190520213052-702d4e7eb465/go.mod h1:zJ2QpyDCYo1KvLXlmdnFlQAyF/Qfth0fB8239Qg7BIE= +gopkg.in/kothar/go-backblaze.v0 v0.0.0-20210124194846-35409b867216/go.mod h1:zJ2QpyDCYo1KvLXlmdnFlQAyF/Qfth0fB8239Qg7BIE= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -2268,7 +2203,6 @@ gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/validator.v2 v2.0.0-20180514200540-135c24b11c19/go.mod h1:o4V0GXN9/CAmCsvJ0oXYZvrZOe7syiDZSN1GWGZTGzc= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -2286,25 +2220,25 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.0.1 h1:omJoilUzyrAp0xNoio88lGJCroGdIOen9hq2A/+3ifw= gorm.io/driver/mysql v1.0.1/go.mod h1:KtqSthtg55lFp3S5kUXqlGaelnWpKitn4k1xZTnoiPw= +gorm.io/driver/mysql v1.4.4 h1:MX0K9Qvy0Na4o7qSC/YI7XxqUw5KDw01umqgID+svdQ= +gorm.io/driver/mysql v1.4.4/go.mod h1:BCg8cKI+R0j/rZRQxeKis/forqRwRSYOR8OM3Wo6hOM= gorm.io/driver/postgres v1.0.0/go.mod h1:wtMFcOzmuA5QigNsgEIb7O5lhvH1tHAF1RbWmLWV4to= -gorm.io/driver/postgres v1.2.3 h1:f4t0TmNMy9gh3TU2PX+EppoA6YsgFnyq8Ojtddb42To= -gorm.io/driver/postgres v1.2.3/go.mod h1:pJV6RgYQPG47aM1f0QeOzFH9HxQc8JcmAgjRCgS0wjs= +gorm.io/driver/postgres v1.4.5 h1:mTeXTTtHAgnS9PgmhN2YeUbazYpLhUI1doLnw42XUZc= +gorm.io/driver/postgres v1.4.5/go.mod h1:GKNQYSJ14qvWkvPwXljMGehpKrhlDNsqYRr5HnYGncg= gorm.io/driver/sqlite v1.1.1 h1:qtWqNAEUyi7gYSUAJXeiAMz0lUOdakZF5ia9Fqnp5G4= gorm.io/driver/sqlite v1.1.1/go.mod h1:hm2olEcl8Tmsc6eZyxYSeznnsDaMqamBvEXLNtBg4cI= gorm.io/driver/sqlserver v1.0.2 h1:FzxAlw0/7hntMzSiNfotpYCo9Lz8dqWQGdmCGqIiFGo= gorm.io/driver/sqlserver v1.0.2/go.mod h1:gb0Y9QePGgqjzrVyTQUZeh9zkd5v0iz71cM1B4ZycEY= gorm.io/gorm v1.9.19/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.20.0/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.22.3/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= -gorm.io/gorm v1.22.4 h1:8aPcyEJhY0MAt8aY6Dc524Pn+pO29K+ydu+e/cXSpQM= -gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= +gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.24.1-0.20221019064659-5dd2bb482755 h1:7AdrbfcvKnzejfqP5g37fdSZOXH/JvaPIzBIHTOqXKk= +gorm.io/gorm v1.24.1-0.20221019064659-5dd2bb482755/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2369,4 +2303,3 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/pkg/repositories/database.go b/pkg/repositories/database.go index fdc663ac6..25757a120 100644 --- a/pkg/repositories/database.go +++ b/pkg/repositories/database.go @@ -2,58 +2,15 @@ package repositories import ( "context" - "errors" "fmt" - "io/ioutil" - "os" - "strings" - "github.com/flyteorg/flytestdlib/database" "gorm.io/driver/sqlite" "github.com/flyteorg/flytestdlib/logger" - "github.com/jackc/pgconn" - "gorm.io/driver/postgres" "gorm.io/gorm" ) -const pqInvalidDBCode = "3D000" -const pqDbAlreadyExistsCode = "42P04" -const defaultDB = "postgres" - -// Resolves a password value from either a user-provided inline value or a filepath whose contents contain a password. -func resolvePassword(ctx context.Context, passwordVal, passwordPath string) string { - password := passwordVal - if len(passwordPath) > 0 { - if _, err := os.Stat(passwordPath); os.IsNotExist(err) { - logger.Fatalf(ctx, - "missing database password at specified path [%s]", passwordPath) - } - passwordVal, err := ioutil.ReadFile(passwordPath) - if err != nil { - logger.Fatalf(ctx, "failed to read database password from path [%s] with err: %v", - passwordPath, err) - } - // Passwords can contain special characters as long as they are percent encoded - // https://www.postgresql.org/docs/current/libpq-connect.html - password = strings.TrimSpace(string(passwordVal)) - } - return password -} - -// Produces the DSN (data source name) for opening a postgres db connection. -func getPostgresDsn(ctx context.Context, pgConfig database.PostgresConfig) string { - password := resolvePassword(ctx, pgConfig.Password, pgConfig.PasswordPath) - if len(password) == 0 { - // The password-less case is included for development environments. - return fmt.Sprintf("host=%s port=%d dbname=%s user=%s sslmode=disable", - pgConfig.Host, pgConfig.Port, pgConfig.DbName, pgConfig.User) - } - return fmt.Sprintf("host=%s port=%d dbname=%s user=%s password=%s %s", - pgConfig.Host, pgConfig.Port, pgConfig.DbName, pgConfig.User, password, pgConfig.ExtraOptions) -} - // GetDB uses the dbConfig to create gorm DB object. If the db doesn't exist for the dbConfig then a new one is created // using the default db for the provider. eg : postgres has default dbName as postgres func GetDB(ctx context.Context, dbConfig *database.DbConfig, logConfig *logger.Config) ( @@ -79,7 +36,13 @@ func GetDB(ctx context.Context, dbConfig *database.DbConfig, logConfig *logger.C return nil, err } case !(dbConfig.Postgres.IsEmpty()): - gormDb, err = createPostgresDbIfNotExists(ctx, gormConfig, dbConfig.Postgres) + gormDb, err = database.CreatePostgresDbIfNotExists(ctx, gormConfig, dbConfig.Postgres) + if err != nil { + return nil, err + } + + case !(dbConfig.Mysql.IsEmpty()): + gormDb, err = database.CreateMysqlDbIfNotExists(ctx, gormConfig, dbConfig.Mysql) if err != nil { return nil, err } @@ -95,7 +58,7 @@ func GetDB(ctx context.Context, dbConfig *database.DbConfig, logConfig *logger.C ExtraOptions: dbConfig.DeprecatedExtraOptions, Debug: dbConfig.DeprecatedDebug, } - gormDb, err = createPostgresDbIfNotExists(ctx, gormConfig, pgConfig) + gormDb, err = database.CreatePostgresDbIfNotExists(ctx, gormConfig, pgConfig) if err != nil { return nil, err } @@ -107,59 +70,6 @@ func GetDB(ctx context.Context, dbConfig *database.DbConfig, logConfig *logger.C return gormDb, setupDbConnectionPool(ctx, gormDb, dbConfig) } -// Creates DB if it doesn't exist for the passed in config -func createPostgresDbIfNotExists(ctx context.Context, gormConfig *gorm.Config, pgConfig database.PostgresConfig) (*gorm.DB, error) { - - dialector := postgres.Open(getPostgresDsn(ctx, pgConfig)) - gormDb, err := gorm.Open(dialector, gormConfig) - if err == nil { - return gormDb, nil - } - - if !isPgErrorWithCode(err, pqInvalidDBCode) { - return nil, err - } - - logger.Warningf(ctx, "Database [%v] does not exist", pgConfig.DbName) - - // Every postgres installation includes a 'postgres' database by default. We connect to that now in order to - // initialize the user-specified database. - defaultDbPgConfig := pgConfig - defaultDbPgConfig.DbName = defaultDB - defaultDBDialector := postgres.Open(getPostgresDsn(ctx, defaultDbPgConfig)) - gormDb, err = gorm.Open(defaultDBDialector, gormConfig) - if err != nil { - return nil, err - } - - // Because we asserted earlier that the db does not exist, we create it now. - logger.Infof(ctx, "Creating database %v", pgConfig.DbName) - - // NOTE: golang sql drivers do not support parameter injection for CREATE calls - createDBStatement := fmt.Sprintf("CREATE DATABASE %s", pgConfig.DbName) - result := gormDb.Exec(createDBStatement) - - if result.Error != nil { - if !isPgErrorWithCode(result.Error, pqDbAlreadyExistsCode) { - return nil, result.Error - } - logger.Warningf(ctx, "Got DB already exists error for [%s], skipping...", pgConfig.DbName) - } - // Now try connecting to the db again - return gorm.Open(dialector, gormConfig) -} - -func isPgErrorWithCode(err error, code string) bool { - pgErr := &pgconn.PgError{} - if !errors.As(err, &pgErr) { - // err chain does not contain a pgconn.PgError - return false - } - - // pgconn.PgError found in chain and set to code specified - return pgErr.Code == code -} - func setupDbConnectionPool(ctx context.Context, gormDb *gorm.DB, dbConfig *database.DbConfig) error { genericDb, err := gormDb.DB() if err != nil { diff --git a/pkg/repositories/database_test.go b/pkg/repositories/database_test.go index 4dea5585e..5c22402c3 100644 --- a/pkg/repositories/database_test.go +++ b/pkg/repositories/database_test.go @@ -2,19 +2,14 @@ package repositories import ( "context" - "errors" - "io/ioutil" - "net" "os" "path" "path/filepath" "testing" "time" - "github.com/flyteorg/flytestdlib/database" - "github.com/jackc/pgconn" - "github.com/flyteorg/flytestdlib/config" + "github.com/flyteorg/flytestdlib/database" "github.com/flyteorg/flytestdlib/logger" "github.com/stretchr/testify/assert" @@ -22,111 +17,6 @@ import ( "gorm.io/gorm" ) -func TestResolvePassword(t *testing.T) { - password := "123abc" - tmpFile, err := ioutil.TempFile("", "prefix") - if err != nil { - t.Errorf("Couldn't open temp file: %v", err) - } - defer tmpFile.Close() - if _, err = tmpFile.WriteString(password); err != nil { - t.Errorf("Couldn't write to temp file: %v", err) - } - resolvedPassword := resolvePassword(context.TODO(), "", tmpFile.Name()) - assert.Equal(t, resolvedPassword, password) -} - -func TestGetPostgresDsn(t *testing.T) { - pgConfig := database.PostgresConfig{ - Host: "localhost", - Port: 5432, - DbName: "postgres", - User: "postgres", - ExtraOptions: "sslmode=disable", - } - t.Run("no password", func(t *testing.T) { - dsn := getPostgresDsn(context.TODO(), pgConfig) - assert.Equal(t, "host=localhost port=5432 dbname=postgres user=postgres sslmode=disable", dsn) - }) - t.Run("with password", func(t *testing.T) { - pgConfig.Password = "pass" - dsn := getPostgresDsn(context.TODO(), pgConfig) - assert.Equal(t, "host=localhost port=5432 dbname=postgres user=postgres password=pass sslmode=disable", dsn) - - }) - t.Run("with password, no extra", func(t *testing.T) { - pgConfig.Password = "pass" - pgConfig.ExtraOptions = "" - dsn := getPostgresDsn(context.TODO(), pgConfig) - assert.Equal(t, "host=localhost port=5432 dbname=postgres user=postgres password=pass ", dsn) - }) - t.Run("with password path", func(t *testing.T) { - password := "123abc" - tmpFile, err := ioutil.TempFile("", "prefix") - if err != nil { - t.Errorf("Couldn't open temp file: %v", err) - } - defer tmpFile.Close() - if _, err = tmpFile.WriteString(password); err != nil { - t.Errorf("Couldn't write to temp file: %v", err) - } - pgConfig.PasswordPath = tmpFile.Name() - dsn := getPostgresDsn(context.TODO(), pgConfig) - assert.Equal(t, "host=localhost port=5432 dbname=postgres user=postgres password=123abc ", dsn) - }) -} - -type wrappedError struct { - err error -} - -func (e *wrappedError) Error() string { - return e.err.Error() -} - -func (e *wrappedError) Unwrap() error { - return e.err -} - -func TestIsInvalidDBPgError(t *testing.T) { - // wrap error with wrappedError when testing to ensure the function checks the whole error chain - - testCases := []struct { - Name string - Err error - ExpectedResult bool - }{ - { - Name: "nil error", - Err: nil, - ExpectedResult: false, - }, - { - Name: "not a PgError", - Err: &wrappedError{err: &net.OpError{Op: "connect", Err: errors.New("connection refused")}}, - ExpectedResult: false, - }, - { - Name: "PgError but not invalid DB", - Err: &wrappedError{&pgconn.PgError{Severity: "FATAL", Message: "out of memory", Code: "53200"}}, - ExpectedResult: false, - }, - { - Name: "PgError and is invalid DB", - Err: &wrappedError{&pgconn.PgError{Severity: "FATAL", Message: "database \"flyte\" does not exist", Code: "3D000"}}, - ExpectedResult: true, - }, - } - - for _, tc := range testCases { - tc := tc - - t.Run(tc.Name, func(t *testing.T) { - assert.Equal(t, tc.ExpectedResult, isPgErrorWithCode(tc.Err, pqInvalidDBCode)) - }) - } -} - func TestSetupDbConnectionPool(t *testing.T) { ctx := context.TODO() t.Run("successful", func(t *testing.T) { @@ -196,41 +86,3 @@ func TestGetDB(t *testing.T) { assert.Equal(t, "sqlite", db.Name()) }) } - -func TestIsPgDbAlreadyExistsError(t *testing.T) { - // wrap error with wrappedError when testing to ensure the function checks the whole error chain - - testCases := []struct { - Name string - Err error - ExpectedResult bool - }{ - { - Name: "nil error", - Err: nil, - ExpectedResult: false, - }, - { - Name: "not a PgError", - Err: &wrappedError{err: &net.OpError{Op: "connect", Err: errors.New("connection refused")}}, - ExpectedResult: false, - }, - { - Name: "PgError but not already exists", - Err: &wrappedError{&pgconn.PgError{Severity: "FATAL", Message: "out of memory", Code: "53200"}}, - ExpectedResult: false, - }, - { - Name: "PgError and is already exists", - Err: &wrappedError{&pgconn.PgError{Severity: "FATAL", Message: "database \"flyte\" does not exist", Code: "42P04"}}, - ExpectedResult: true, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.Name, func(t *testing.T) { - assert.Equal(t, tc.ExpectedResult, isPgErrorWithCode(tc.Err, pqDbAlreadyExistsCode)) - }) - } -} From 49a2ec27e69ad3936961be655a0810d7d3a2afe3 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Mon, 5 Dec 2022 15:34:08 -0800 Subject: [PATCH 02/37] check mysql first since postgres has a default Signed-off-by: Yee Hing Tong --- pkg/repositories/database.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/repositories/database.go b/pkg/repositories/database.go index 25757a120..903cf7bc1 100644 --- a/pkg/repositories/database.go +++ b/pkg/repositories/database.go @@ -35,18 +35,16 @@ func GetDB(ctx context.Context, dbConfig *database.DbConfig, logConfig *logger.C if err != nil { return nil, err } - case !(dbConfig.Postgres.IsEmpty()): - gormDb, err = database.CreatePostgresDbIfNotExists(ctx, gormConfig, dbConfig.Postgres) + case !(dbConfig.Mysql.IsEmpty()): + gormDb, err = database.CreateMysqlDbIfNotExists(ctx, gormConfig, dbConfig.Mysql) if err != nil { return nil, err } - - case !(dbConfig.Mysql.IsEmpty()): - gormDb, err = database.CreateMysqlDbIfNotExists(ctx, gormConfig, dbConfig.Mysql) + case !(dbConfig.Postgres.IsEmpty()): + gormDb, err = database.CreatePostgresDbIfNotExists(ctx, gormConfig, dbConfig.Postgres) if err != nil { return nil, err } - case len(dbConfig.DeprecatedHost) > 0 || len(dbConfig.DeprecatedUser) > 0 || len(dbConfig.DeprecatedDbName) > 0: pgConfig := database.PostgresConfig{ Host: dbConfig.DeprecatedHost, From 66d556a0e5d2dbae85635cbbaef0fc9a8100d999 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 6 Dec 2022 15:14:36 -0800 Subject: [PATCH 03/37] lowered the column sizes enough to get the node execution event table to pass migration. Signed-off-by: Yee Hing Tong --- pkg/repositories/models/execution.go | 6 +++--- pkg/repositories/models/node_execution.go | 2 +- pkg/repositories/models/node_execution_event.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/repositories/models/execution.go b/pkg/repositories/models/execution.go index 08c248a64..f619cd653 100644 --- a/pkg/repositories/models/execution.go +++ b/pkg/repositories/models/execution.go @@ -11,9 +11,9 @@ import ( // Execution primary key type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|255)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|255)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|255)"` + Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` } // Database model to encapsulate a (workflow) execution. diff --git a/pkg/repositories/models/node_execution.go b/pkg/repositories/models/node_execution.go index 100ab557c..f45c8caec 100644 --- a/pkg/repositories/models/node_execution.go +++ b/pkg/repositories/models/node_execution.go @@ -9,7 +9,7 @@ import ( type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"primary_key;index" valid:"length(0|255)"` + NodeID string `gorm:"size:180;primary_key;index" valid:"length(0|180)"` } // By convention, gorm foreign key references are of the form {ModelName}ID diff --git a/pkg/repositories/models/node_execution_event.go b/pkg/repositories/models/node_execution_event.go index cd362c8ff..550540231 100644 --- a/pkg/repositories/models/node_execution_event.go +++ b/pkg/repositories/models/node_execution_event.go @@ -9,5 +9,5 @@ type NodeExecutionEvent struct { NodeExecutionKey RequestID string OccurredAt time.Time - Phase string `gorm:"primary_key"` + Phase string `gorm:"size:128;primary_key"` } From a160b2e7372b62d4c1fcaf75eee23a49117e6166 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Mon, 13 Mar 2023 08:52:12 -0700 Subject: [PATCH 04/37] WIP - mysql support Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migration_models.go | 28 +++--- pkg/repositories/config/migrations.go | 90 ++++++++++++------- pkg/repositories/models/base_model.go | 4 +- pkg/repositories/models/description_entity.go | 16 ++-- pkg/repositories/models/resource.go | 10 +-- pkg/repositories/models/task.go | 12 +-- pkg/repositories/models/task_execution.go | 2 + pkg/server/initialize.go | 1 + 8 files changed, 98 insertions(+), 65 deletions(-) diff --git a/pkg/repositories/config/migration_models.go b/pkg/repositories/config/migration_models.go index b46b93858..4d33f2ff4 100644 --- a/pkg/repositories/config/migration_models.go +++ b/pkg/repositories/config/migration_models.go @@ -13,21 +13,21 @@ import ( */ type TaskKey struct { - Project string `gorm:"primary_key"` - Domain string `gorm:"primary_key"` - Name string `gorm:"primary_key"` - Version string `gorm:"primary_key"` + Project string `gorm:"size:64;primary_key"` + Domain string `gorm:"size:100;primary_key"` + Name string `gorm:"size:100;primary_key"` + Version string `gorm:"size:100;primary_key"` } type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project"` - Domain string `gorm:"primary_key;column:execution_domain"` - Name string `gorm:"primary_key;column:execution_name"` + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:100;primary_key;column:execution_domain"` + Name string `gorm:"size:100;primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"primary_key;index"` + NodeID string `gorm:"size:100;primary_key;index"` } type NodeExecution struct { @@ -57,10 +57,10 @@ type NodeExecution struct { type TaskExecutionKey struct { TaskKey - Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` + Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"size:100;primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"size:100;primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"size:100;primary_key;index:idx_task_executions_exec;index"` // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` @@ -69,9 +69,9 @@ type TaskExecutionKey struct { type TaskExecution struct { models.BaseModel TaskExecutionKey - Phase string + Phase string `gorm:"size:100"` PhaseVersion uint32 - InputURI string + InputURI string `gorm:"size:100"` Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the TaskExecution closure diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index cc441b478..7d354dbaf 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -17,6 +17,11 @@ var ( "schedule_entities_snapshots", "task_executions", "tasks", "workflows", "description_entities"} ) +// var gorm_models = map[string]interface{}{ +// "execution_events": &models.ExecutionEvent{}, +// } + + var Migrations = []*gormigrate.Migration{ // Create projects table. { @@ -200,13 +205,26 @@ var Migrations = []*gormigrate.Migration{ return tx.Exec("UPDATE named_entity_metadata set state = NULL").Error }, }, + // FIXME: the syntax ALTER TABLE T DROP COLUMN IF EXISTS c is invalid in mysql. + // TODO: remove mentions to that from other queries ((including rollbacks)) // Modify the workflows table, if necessary { ID: "2020-04-03-workflow-state", Migrate: func(tx *gorm.DB) error { - return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS state").Error + if !tx.Model(&models.Workflow{}).Migrator().HasColumn(&models.Workflow{}, "state") { + return nil + } + if err := tx.Model(&models.Workflow{}).Migrator().DropColumn(&models.Workflow{}, "state"); err != nil { + return err + } + return nil; }, Rollback: func(tx *gorm.DB) error { + // TODO: the column state is not going to be present in the model. Does this mean that we cannot + // rely on gorm to restore the column? + // if err := tx.Model(&models.Workflow{}).Migrator().AddColumn(&models.Workflow{}, "state"); err != nil { + // return err + // } return tx.Exec("ALTER TABLE workflows ADD COLUMN IF NOT EXISTS state integer;").Error }, }, @@ -339,17 +357,17 @@ var Migrations = []*gormigrate.Migration{ return tx.Migrator().DropTable(&schedulerModels.ScheduleEntitiesSnapshot{}, "schedulable_entities_snapshot") }, }, - // For any new table, Please use the following pattern due to a bug // in the postgres gorm layer https://github.com/go-gorm/postgres/issues/65 { ID: "2022-01-11-id-to-bigint", Migrate: func(tx *gorm.DB) error { - db, err := tx.DB() - if err != nil { - return err - } - return alterTableColumnType(db, "id", "bigint") + return nil + // db, err := tx.DB() + // if err != nil { + // return err + // } + // return alterTableColumnType(db, "id", "bigint") }, Rollback: func(tx *gorm.DB) error { db, err := tx.DB() @@ -400,27 +418,27 @@ var Migrations = []*gormigrate.Migration{ return tx.Migrator().DropTable("description_entities") }, }, - // Modify the tasks table, if necessary - { - ID: "2020-09-13-task-short_description", - Migrate: func(tx *gorm.DB) error { - return tx.Exec("ALTER TABLE tasks ADD COLUMN IF NOT EXISTS short_description varchar(4000)").Error - }, - Rollback: func(tx *gorm.DB) error { - return tx.Exec("ALTER TABLE tasks DROP COLUMN IF EXISTS short_description").Error - }, - }, - // Modify the workflows table, if necessary - { - ID: "2020-09-13-workflow-short_description", - Migrate: func(tx *gorm.DB) error { - return tx.Exec("ALTER TABLE workflows ADD COLUMN IF NOT EXISTS short_description varchar(4000)").Error - }, - Rollback: func(tx *gorm.DB) error { - return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS short_description").Error - }, - }, - // Create signals table. + // // Modify the tasks table, if necessary + // { + // ID: "2020-09-13-task-short_description", + // Migrate: func(tx *gorm.DB) error { + // return tx.Exec("ALTER TABLE tasks ADD COLUMN IF NOT EXISTS short_description varchar(4000)").Error + // }, + // Rollback: func(tx *gorm.DB) error { + // return tx.Exec("ALTER TABLE tasks DROP COLUMN IF EXISTS short_description").Error + // }, + // }, + // // Modify the workflows table, if necessary + // { + // ID: "2020-09-13-workflow-short_description", + // Migrate: func(tx *gorm.DB) error { + // return tx.Exec("ALTER TABLE workflows ADD COLUMN IF NOT EXISTS short_description varchar(4000)").Error + // }, + // Rollback: func(tx *gorm.DB) error { + // return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS short_description").Error + // }, + // }, + // // Create signals table. { ID: "2022-04-11-signals", Migrate: func(tx *gorm.DB) error { @@ -446,10 +464,22 @@ func alterTableColumnType(db *sql.DB, columnName, columnType string) error { var err error for _, table := range tables { - if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, - columnType)); err != nil { + // if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, + // columnType)); err != nil { + // return err + // } + // TODO: figure out how to get the driver name + if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE %s MODIFY COLUMN %s %s`, table, columnName, columnType)); err != nil { return err } } return nil } + +// func alterTableColumnTypeGorm(tx *gorm.DB, columnName, columnType string) error { +// for tableName, model := range gorm_models { +// if tx.Model(model).Migrator().HasColumn(model, "columnName") { +// tx.Migrator().MigrateColumn(model, field *schema.Field, columnType gorm.ColumnType) +// } +// } +// } diff --git a/pkg/repositories/models/base_model.go b/pkg/repositories/models/base_model.go index bfc5776ce..fcfcff428 100644 --- a/pkg/repositories/models/base_model.go +++ b/pkg/repositories/models/base_model.go @@ -7,7 +7,7 @@ import "time" // own primary keys rather than use the ID as the primary key type BaseModel struct { ID uint `gorm:"index;autoIncrement"` - CreatedAt time.Time - UpdatedAt time.Time + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` } diff --git a/pkg/repositories/models/description_entity.go b/pkg/repositories/models/description_entity.go index 3a5c71625..c7290bca9 100644 --- a/pkg/repositories/models/description_entity.go +++ b/pkg/repositories/models/description_entity.go @@ -5,15 +5,15 @@ import "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" // DescriptionEntityKey DescriptionEntity primary key type DescriptionEntityKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` } // SourceCode Database model to encapsulate a SourceCode. type SourceCode struct { - Link string `valid:"length(0|255)"` + Link string `gorm:"size:100" valid:"length(0|255)"` } // DescriptionEntity Database model to encapsulate a DescriptionEntity. @@ -22,9 +22,9 @@ type DescriptionEntity struct { BaseModel - ShortDescription string + SourceCode - LongDescription []byte + ShortDescription string `gorm:"size:100` - SourceCode + LongDescription []byte } diff --git a/pkg/repositories/models/resource.go b/pkg/repositories/models/resource.go index 01c570296..ae91919dd 100644 --- a/pkg/repositories/models/resource.go +++ b/pkg/repositories/models/resource.go @@ -18,11 +18,11 @@ type Resource struct { CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Project string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte diff --git a/pkg/repositories/models/task.go b/pkg/repositories/models/task.go index 53ee1c8b8..3a8ca9fa9 100644 --- a/pkg/repositories/models/task.go +++ b/pkg/repositories/models/task.go @@ -5,10 +5,10 @@ package models // Task primary key type TaskKey struct { - Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key" valid:"length(0|255)"` + Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"size:100;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"size:100;primary_key" valid:"length(0|255)"` } // Database model to encapsulate a task. @@ -19,7 +19,7 @@ type Task struct { // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `valid:"length(0|255)"` + Type string `gorm:"size:100" valid:"length(0|255)"` // ShortDescription for the task. - ShortDescription string + ShortDescription string `gorm:"size:100"` } diff --git a/pkg/repositories/models/task_execution.go b/pkg/repositories/models/task_execution.go index d1f8ad243..1f5717481 100644 --- a/pkg/repositories/models/task_execution.go +++ b/pkg/repositories/models/task_execution.go @@ -6,6 +6,8 @@ import ( // IMPORTANT: If you update the model below, be sure to double check model definitions in // pkg/repositories/config/migration_models.go +// +// TODO: why do we have copies of the models present in this file in pkg/repositories/config/migration_models.go? // Task execution primary key type TaskExecutionKey struct { diff --git a/pkg/server/initialize.go b/pkg/server/initialize.go index 69c384676..3cc66a2ac 100644 --- a/pkg/server/initialize.go +++ b/pkg/server/initialize.go @@ -43,6 +43,7 @@ func withDB(ctx context.Context, do func(db *gorm.DB) error) error { // Migrate runs all configured migrations func Migrate(ctx context.Context) error { return withDB(ctx, func(db *gorm.DB) error { + // TODO: filter out the migrations that shouldn't affect mysql. Use `db.Dialector.Name()` m := gormigrate.New(db, gormigrate.DefaultOptions, config.Migrations) if err := m.Migrate(); err != nil { return fmt.Errorf("database migration failed: %v", err) From 1fe4dd298936d1ef81e7e25307039c517358b538 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Fri, 17 Mar 2023 15:02:26 -0700 Subject: [PATCH 05/37] add new migrations Signed-off-by: Yee Hing Tong --- pkg/repositories/config/migrations.go | 395 ++++++++++++++++++++- pkg/repositories/config/migrations_test.go | 49 ++- 2 files changed, 426 insertions(+), 18 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index af7bbe8ba..a73355b60 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/flyteorg/flyteadmin/pkg/repositories/models" schedulerModels "github.com/flyteorg/flyteadmin/scheduler/repositories/models" + "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" "github.com/go-gormigrate/gormigrate/v2" "gorm.io/gorm" "time" @@ -483,25 +484,387 @@ func alterTableColumnType(db *sql.DB, columnName, columnType string) error { // } // } -type NewProject struct { - ID uint `gorm:"index;autoIncrement"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Identifier string `gorm:"primary_key"` - Name string `gorm:"type:varchar(64);size:255"` // Human-readable name, not a unique identifier. - Description string `gorm:"type:varchar(300)"` - Labels []byte - // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0;index"` -} - var Migrations = []*gormigrate.Migration{ - // Create projects table. + /* The following is a series of Postgres specific migrations. They should mirror the state + of the database as of 2023 March. The rollback is a noop for everything because the migration itself should + be a noop. + */ + // need to add not null, re-running old migrations now seems to drop the not null constraint on ID. + + { + ID: "pg-noop-2023-03-31-noop-project-3", + Migrate: func(tx *gorm.DB) error { + type Project struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Identifier string `gorm:"primary_key"` + Name string `valid:"length(0|255)"` // Human-readable name, not a unique identifier. + Description string `gorm:"type:varchar(300)"` + Labels []byte + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0;index"` + } + return tx.AutoMigrate(&Project{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + // ALTER TABLE "projects" ALTER COLUMN "id" DROP NOT NULL otherwise. + + { + ID: "pg-noop-2023-03-31-noop-task-2", + Migrate: func(tx *gorm.DB) error { + type Task struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` + Closure []byte `gorm:"not null"` + // Hash of the compiled task closure + Digest []byte + // Task type (also stored in the closure put promoted as a column for filtering). + Type string `gorm:"" valid:"length(0|255)"` + // ShortDescription for the task. + ShortDescription string + } + return tx.AutoMigrate(&Task{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-workflow", + Migrate: func(tx *gorm.DB) error { + type Workflow struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key"` + TypedInterface []byte + RemoteClosureIdentifier string `gorm:"not null" valid:"length(0|255)"` + // Hash of the compiled workflow closure + Digest []byte + // ShortDescription for the workflow. + ShortDescription string + } + return tx.AutoMigrate(&Workflow{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { - ID: "2022-12-09-execution-launch-typefdsafdsa", + ID: "pg-noop-2023-03-31-noop-launchplan", Migrate: func(tx *gorm.DB) error { - return tx.AutoMigrate(&models.Execution{}) + type LaunchPlanScheduleType string + + const ( + LaunchPlanScheduleTypeNONE LaunchPlanScheduleType = "NONE" + LaunchPlanScheduleTypeCRON LaunchPlanScheduleType = "CRON" + LaunchPlanScheduleTypeRATE LaunchPlanScheduleType = "RATE" + ) + + type LaunchPlan struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:lp_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0"` + // Hash of the launch plan + Digest []byte + ScheduleType LaunchPlanScheduleType + } + return tx.AutoMigrate(&LaunchPlan{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-namedentitymetadata", + Migrate: func(tx *gorm.DB) error { + type NamedEntityMetadata struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Description string `gorm:"type:varchar(300)"` + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0"` + } + + return tx.AutoMigrate(&NamedEntityMetadata{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-taskexecution-3", + Migrate: func(tx *gorm.DB) error { + type TaskKey struct { + Project string `gorm:"primary_key"` + Domain string `gorm:"primary_key"` + Name string `gorm:"primary_key"` + Version string `gorm:"primary_key"` + } + type TaskExecutionKey struct { + TaskKey + Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` + // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. + // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. + RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` + } + type TaskExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + TaskExecutionKey + Phase string `gorm:"type:text"` + PhaseVersion uint32 + InputURI string `gorm:"type:text"` + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was createdAt, not to be confused with gorm.Model.CreatedAt + TaskExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt + TaskExecutionUpdatedAt *time.Time + Duration time.Duration + // The child node executions (if any) launched by this task execution. + ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` + } + + return tx.AutoMigrate(&TaskExecution{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + // ALTER TABLE "task_executions" ALTER COLUMN "phase" TYPE varchar(100) USING "phase"::varchar(100) + // ALTER TABLE "task_executions" ALTER COLUMN "input_uri" TYPE varchar(100) USING "input_uri"::varchar(100) + + { + ID: "pg-noop-2023-03-31-noop-nodeexecution-2", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"primary_key;column:execution_project"` + Domain string `gorm:"primary_key;column:execution_domain"` + Name string `gorm:"primary_key;column:execution_name"` + } + + type NodeExecutionKey struct { + ExecutionKey + NodeID string `gorm:"primary_key;index"` + } + type NodeExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + NodeExecutionKey + // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. + Phase string + InputURI string + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the NodeExecution closure + // Prefixed with NodeExecution to avoid clashes with gorm.Model CreatedAt + NodeExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the NodeExecution closure + // Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt + NodeExecutionUpdatedAt *time.Time + Duration time.Duration + // The task execution (if any) which launched this node execution. + ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` + // The workflow execution (if any) which this node execution launched + LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` + // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. + DynamicWorkflowRemoteClosureReference string + // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. + InternalData []byte + } + + return tx.AutoMigrate(&NodeExecution{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-execution-event", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` + } + type ExecutionEvent struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + ExecutionKey + RequestID string `valid:"length(0|255)"` + OccurredAt time.Time + Phase string `gorm:"primary_key"` + } + + return tx.AutoMigrate(&ExecutionEvent{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-node-execution-event", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` + } + type NodeExecutionKey struct { + ExecutionKey + NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` + } + type NodeExecutionEvent struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + NodeExecutionKey + RequestID string + OccurredAt time.Time + Phase string `gorm:"primary_key"` + } + + return tx.AutoMigrate(&NodeExecutionEvent{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-description-entity-2", + Migrate: func(tx *gorm.DB) error { + type DescriptionEntityKey struct { + ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + } + + // SourceCode Database model to encapsulate a SourceCode. + type SourceCode struct { + Link string `valid:"length(0|255)"` + } + + // DescriptionEntity Database model to encapsulate a DescriptionEntity. + type DescriptionEntity struct { + DescriptionEntityKey + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + SourceCode + ShortDescription string + LongDescription []byte + } + + return tx.AutoMigrate(&DescriptionEntity{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-signal", + Migrate: func(tx *gorm.DB) error { + type SignalKey struct { + ExecutionKey + SignalID string `gorm:"primary_key;index" valid:"length(0|255)"` + } + + type Signal struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + SignalKey + Type []byte `gorm:"not null"` + Value []byte + } + + return tx.AutoMigrate(&Signal{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-resource-3", + Migrate: func(tx *gorm.DB) error { + type ResourcePriority int32 + + // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique + type Resource struct { + ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time `sql:"index"` + Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Priority ResourcePriority + // Serialized flyteidl.admin.MatchingAttributes. + Attributes []byte + } + + return tx.AutoMigrate(&Resource{}) }, Rollback: func(tx *gorm.DB) error { return nil diff --git a/pkg/repositories/config/migrations_test.go b/pkg/repositories/config/migrations_test.go index 29f798051..6d43420a7 100644 --- a/pkg/repositories/config/migrations_test.go +++ b/pkg/repositories/config/migrations_test.go @@ -1,10 +1,17 @@ package config import ( - "testing" - + "context" + "fmt" mocket "github.com/Selvatico/go-mocket" + "github.com/flyteorg/flytestdlib/database" + "github.com/go-gormigrate/gormigrate/v2" "github.com/stretchr/testify/assert" + gormLogger "gorm.io/gorm/logger" + "log" + "os" + "testing" + "time" "gorm.io/driver/postgres" "gorm.io/gorm" @@ -32,3 +39,41 @@ func GetDbForTest(t *testing.T) *gorm.DB { } return db } + +func TestMigrations(t *testing.T) { + gLogger := gormLogger.New(log.New(os.Stdout, "\r\n", log.LstdFlags), gormLogger.Config{ + SlowThreshold: 200 * time.Millisecond, + LogLevel: gormLogger.Info, + IgnoreRecordNotFoundError: false, + Colorful: true, + }) + + gormConfig := &gorm.Config{ + Logger: gLogger, + DisableForeignKeyConstraintWhenMigrating: false, + } + + var gormDb *gorm.DB + pgConfig := database.PostgresConfig{ + Host: "localhost", + Port: 30001, + DbName: "flyte", + User: "postgres", + Password: "postgres", + ExtraOptions: "", + Debug: false, + } + ctx := context.Background() + postgresDsn := database.PostgresDsn(ctx, pgConfig) + dialector := postgres.Open(postgresDsn) + gormDb, err := gorm.Open(dialector, gormConfig) + assert.NoError(t, err) + + fmt.Println(gormDb) + + m := gormigrate.New(gormDb, gormigrate.DefaultOptions, Migrations) + if err := m.Migrate(); err != nil { + fmt.Errorf("database migration failed: %v", err) + } + fmt.Println(ctx, "Migration ran successfully") +} From a68cc1c8a5e8067c584c48a92aaf7790a60519b2 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Fri, 17 Mar 2023 15:05:58 -0700 Subject: [PATCH 06/37] undo all the size deletions Signed-off-by: Yee Hing Tong --- pkg/repositories/config/migrations.go | 94 ++++++++++++--------------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index a73355b60..9c0900a01 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -489,7 +489,6 @@ var Migrations = []*gormigrate.Migration{ of the database as of 2023 March. The rollback is a noop for everything because the migration itself should be a noop. */ - // need to add not null, re-running old migrations now seems to drop the not null constraint on ID. { ID: "pg-noop-2023-03-31-noop-project-3", @@ -512,27 +511,26 @@ var Migrations = []*gormigrate.Migration{ return nil }, }, - // ALTER TABLE "projects" ALTER COLUMN "id" DROP NOT NULL otherwise. { - ID: "pg-noop-2023-03-31-noop-task-2", + ID: "pg-noop-2023-03-31-noop-task", Migrate: func(tx *gorm.DB) error { type Task struct { ID uint `gorm:"index;autoIncrement;not null"` CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key" valid:"length(0|255)"` + Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"size:100;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"size:100;primary_key" valid:"length(0|255)"` Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"" valid:"length(0|255)"` + Type string `gorm:"size:100" valid:"length(0|255)"` // ShortDescription for the task. - ShortDescription string + ShortDescription string `gorm:"size:100"` } return tx.AutoMigrate(&Task{}) }, @@ -572,12 +570,6 @@ var Migrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type LaunchPlanScheduleType string - const ( - LaunchPlanScheduleTypeNONE LaunchPlanScheduleType = "NONE" - LaunchPlanScheduleTypeCRON LaunchPlanScheduleType = "CRON" - LaunchPlanScheduleTypeRATE LaunchPlanScheduleType = "RATE" - ) - type LaunchPlan struct { ID uint `gorm:"index;autoIncrement;not null"` CreatedAt time.Time `gorm:"type:time"` @@ -628,20 +620,20 @@ var Migrations = []*gormigrate.Migration{ }, { - ID: "pg-noop-2023-03-31-noop-taskexecution-3", + ID: "pg-noop-2023-03-31-noop-taskexecution", Migrate: func(tx *gorm.DB) error { type TaskKey struct { - Project string `gorm:"primary_key"` - Domain string `gorm:"primary_key"` - Name string `gorm:"primary_key"` - Version string `gorm:"primary_key"` + Project string `gorm:"size:64;primary_key"` + Domain string `gorm:"size:100;primary_key"` + Name string `gorm:"size:100;primary_key"` + Version string `gorm:"size:100;primary_key"` } type TaskExecutionKey struct { TaskKey - Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` + Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"size:100;primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"size:100;primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"size:100;primary_key;index:idx_task_executions_exec;index"` // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` @@ -652,7 +644,7 @@ var Migrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` TaskExecutionKey - Phase string `gorm:"type:text"` + Phase string `gorm:"type:text;size:100"` PhaseVersion uint32 InputURI string `gorm:"type:text"` Closure []byte @@ -680,17 +672,17 @@ var Migrations = []*gormigrate.Migration{ // ALTER TABLE "task_executions" ALTER COLUMN "input_uri" TYPE varchar(100) USING "input_uri"::varchar(100) { - ID: "pg-noop-2023-03-31-noop-nodeexecution-2", + ID: "pg-noop-2023-03-31-noop-nodeexecution", Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project"` - Domain string `gorm:"primary_key;column:execution_domain"` - Name string `gorm:"primary_key;column:execution_name"` + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:100;primary_key;column:execution_domain"` + Name string `gorm:"size:100;primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"primary_key;index"` + NodeID string `gorm:"size:100;primary_key;index"` } type NodeExecution struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -731,9 +723,9 @@ var Migrations = []*gormigrate.Migration{ ID: "pg-noop-2023-03-31-noop-execution-event", Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` + Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` } type ExecutionEvent struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -757,13 +749,13 @@ var Migrations = []*gormigrate.Migration{ ID: "pg-noop-2023-03-31-noop-node-execution-event", Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` + Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` + NodeID string `gorm:"size:180;primary_key;index" valid:"length(0|180)"` } type NodeExecutionEvent struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -773,7 +765,7 @@ var Migrations = []*gormigrate.Migration{ NodeExecutionKey RequestID string OccurredAt time.Time - Phase string `gorm:"primary_key"` + Phase string `gorm:"size:128;primary_key"` } return tx.AutoMigrate(&NodeExecutionEvent{}) @@ -784,19 +776,19 @@ var Migrations = []*gormigrate.Migration{ }, { - ID: "pg-noop-2023-03-31-noop-description-entity-2", + ID: "pg-noop-2023-03-31-noop-description-entity", Migrate: func(tx *gorm.DB) error { type DescriptionEntityKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` } // SourceCode Database model to encapsulate a SourceCode. type SourceCode struct { - Link string `valid:"length(0|255)"` + Link string `gorm:"typesize:100" valid:"length(0|255)"` } // DescriptionEntity Database model to encapsulate a DescriptionEntity. @@ -807,7 +799,7 @@ var Migrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` SourceCode - ShortDescription string + ShortDescription string `gorm:"type:text;size:100` LongDescription []byte } @@ -844,7 +836,7 @@ var Migrations = []*gormigrate.Migration{ }, { - ID: "pg-noop-2023-03-31-noop-resource-3", + ID: "pg-noop-2023-03-31-noop-resource", Migrate: func(tx *gorm.DB) error { type ResourcePriority int32 @@ -854,11 +846,11 @@ var Migrations = []*gormigrate.Migration{ CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Project string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte From e6dbda944806b782f0c162b6523fb30c06c6c0c6 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Thu, 23 Mar 2023 16:41:04 -0700 Subject: [PATCH 07/37] Revert "undo all the size deletions" This reverts commit a68cc1c8a5e8067c584c48a92aaf7790a60519b2. Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migrations.go | 94 +++++++++++++++------------ 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 9c0900a01..a73355b60 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -489,6 +489,7 @@ var Migrations = []*gormigrate.Migration{ of the database as of 2023 March. The rollback is a noop for everything because the migration itself should be a noop. */ + // need to add not null, re-running old migrations now seems to drop the not null constraint on ID. { ID: "pg-noop-2023-03-31-noop-project-3", @@ -511,26 +512,27 @@ var Migrations = []*gormigrate.Migration{ return nil }, }, + // ALTER TABLE "projects" ALTER COLUMN "id" DROP NOT NULL otherwise. { - ID: "pg-noop-2023-03-31-noop-task", + ID: "pg-noop-2023-03-31-noop-task-2", Migrate: func(tx *gorm.DB) error { type Task struct { ID uint `gorm:"index;autoIncrement;not null"` CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"size:100;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"size:100;primary_key" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"size:100" valid:"length(0|255)"` + Type string `gorm:"" valid:"length(0|255)"` // ShortDescription for the task. - ShortDescription string `gorm:"size:100"` + ShortDescription string } return tx.AutoMigrate(&Task{}) }, @@ -570,6 +572,12 @@ var Migrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type LaunchPlanScheduleType string + const ( + LaunchPlanScheduleTypeNONE LaunchPlanScheduleType = "NONE" + LaunchPlanScheduleTypeCRON LaunchPlanScheduleType = "CRON" + LaunchPlanScheduleTypeRATE LaunchPlanScheduleType = "RATE" + ) + type LaunchPlan struct { ID uint `gorm:"index;autoIncrement;not null"` CreatedAt time.Time `gorm:"type:time"` @@ -620,20 +628,20 @@ var Migrations = []*gormigrate.Migration{ }, { - ID: "pg-noop-2023-03-31-noop-taskexecution", + ID: "pg-noop-2023-03-31-noop-taskexecution-3", Migrate: func(tx *gorm.DB) error { type TaskKey struct { - Project string `gorm:"size:64;primary_key"` - Domain string `gorm:"size:100;primary_key"` - Name string `gorm:"size:100;primary_key"` - Version string `gorm:"size:100;primary_key"` + Project string `gorm:"primary_key"` + Domain string `gorm:"primary_key"` + Name string `gorm:"primary_key"` + Version string `gorm:"primary_key"` } type TaskExecutionKey struct { TaskKey - Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"size:100;primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"size:100;primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"size:100;primary_key;index:idx_task_executions_exec;index"` + Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` @@ -644,7 +652,7 @@ var Migrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` TaskExecutionKey - Phase string `gorm:"type:text;size:100"` + Phase string `gorm:"type:text"` PhaseVersion uint32 InputURI string `gorm:"type:text"` Closure []byte @@ -672,17 +680,17 @@ var Migrations = []*gormigrate.Migration{ // ALTER TABLE "task_executions" ALTER COLUMN "input_uri" TYPE varchar(100) USING "input_uri"::varchar(100) { - ID: "pg-noop-2023-03-31-noop-nodeexecution", + ID: "pg-noop-2023-03-31-noop-nodeexecution-2", Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { - Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:100;primary_key;column:execution_domain"` - Name string `gorm:"size:100;primary_key;column:execution_name"` + Project string `gorm:"primary_key;column:execution_project"` + Domain string `gorm:"primary_key;column:execution_domain"` + Name string `gorm:"primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:100;primary_key;index"` + NodeID string `gorm:"primary_key;index"` } type NodeExecution struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -723,9 +731,9 @@ var Migrations = []*gormigrate.Migration{ ID: "pg-noop-2023-03-31-noop-execution-event", Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { - Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` } type ExecutionEvent struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -749,13 +757,13 @@ var Migrations = []*gormigrate.Migration{ ID: "pg-noop-2023-03-31-noop-node-execution-event", Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { - Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:180;primary_key;index" valid:"length(0|180)"` + NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` } type NodeExecutionEvent struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -765,7 +773,7 @@ var Migrations = []*gormigrate.Migration{ NodeExecutionKey RequestID string OccurredAt time.Time - Phase string `gorm:"size:128;primary_key"` + Phase string `gorm:"primary_key"` } return tx.AutoMigrate(&NodeExecutionEvent{}) @@ -776,19 +784,19 @@ var Migrations = []*gormigrate.Migration{ }, { - ID: "pg-noop-2023-03-31-noop-description-entity", + ID: "pg-noop-2023-03-31-noop-description-entity-2", Migrate: func(tx *gorm.DB) error { type DescriptionEntityKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` } // SourceCode Database model to encapsulate a SourceCode. type SourceCode struct { - Link string `gorm:"typesize:100" valid:"length(0|255)"` + Link string `valid:"length(0|255)"` } // DescriptionEntity Database model to encapsulate a DescriptionEntity. @@ -799,7 +807,7 @@ var Migrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` SourceCode - ShortDescription string `gorm:"type:text;size:100` + ShortDescription string LongDescription []byte } @@ -836,7 +844,7 @@ var Migrations = []*gormigrate.Migration{ }, { - ID: "pg-noop-2023-03-31-noop-resource", + ID: "pg-noop-2023-03-31-noop-resource-3", Migrate: func(tx *gorm.DB) error { type ResourcePriority int32 @@ -846,11 +854,11 @@ var Migrations = []*gormigrate.Migration{ CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte From b83482ad38d9bdf2d175b091ff459e5644328b0d Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 22 Mar 2023 14:12:46 -0700 Subject: [PATCH 08/37] Add Fixup migrations Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 501 ++++++++++++++++++++++++++ pkg/server/initialize.go | 5 +- 2 files changed, 503 insertions(+), 3 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index e71750e1b..d718d6b71 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -962,6 +962,507 @@ var NoopMigrations = []*gormigrate.Migration{ }, } +var FixupMigrations = []*gormigrate.Migration{ + // These migrations modify the column types from `text` to a bounded string type (i.e. varchar). + { + ID: "2023-03-31-fixup-project", + Migrate: func(tx *gorm.DB) error { + type Project struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Identifier string `gorm:"primary_key"` + Name string `gorm:"size:64"` // Human-readable name, not a unique identifier. + Description string `gorm:"type:varchar(300)"` + Labels []byte + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0;index"` + } + return tx.AutoMigrate(&Project{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-task", + Migrate: func(tx *gorm.DB) error { + type Task struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" gorm:""` + Domain string `gorm:"size:255;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx"` + Name string `gorm:"size:255;primary_key;index:task_project_domain_name_idx"` + Version string `gorm:"size:255;primary_key"` + Closure []byte `gorm:"not null"` + // Hash of the compiled task closure + Digest []byte + // Task type (also stored in the closure put promoted as a column for filtering). + Type string `gorm:"size:255"` + // ShortDescription for the task. + ShortDescription string `gorm:"size:255"` + } + return tx.AutoMigrate(&Task{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-workflow", + Migrate: func(tx *gorm.DB) error { + type Workflow struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` + Domain string `gorm:"size:255;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` + Name string `gorm:"size:255;primary_key;index:workflow_project_domain_name_idx"` + Version string `gorm:"size:255;primary_key"` + TypedInterface []byte + RemoteClosureIdentifier string `gorm:"size:255;not null"` + // Hash of the compiled workflow closure + Digest []byte + // ShortDescription for the workflow. + ShortDescription string `gorm:"size:255"` + } + return tx.AutoMigrate(&Workflow{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-launchplan", + Migrate: func(tx *gorm.DB) error { + type LaunchPlanScheduleType string + + type LaunchPlan struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` + Domain string `gorm:"size:255;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` + Name string `gorm:"size:255;primary_key;index:lp_project_domain_name_idx"` + Version string `gorm:"size:255;primary_key"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0"` + // Hash of the launch plan + Digest []byte + ScheduleType LaunchPlanScheduleType `gorm:"size:255"` + } + return tx.AutoMigrate(&LaunchPlan{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-namedentitymetadata", + Migrate: func(tx *gorm.DB) error { + type NamedEntityMetadata struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + ResourceType core.ResourceType `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + Project string `gorm:"size:64;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + Domain string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + Name string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + Description string `gorm:"type:varchar(300)"` + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0"` + } + + return tx.AutoMigrate(&NamedEntityMetadata{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-execution", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:255;primary_key;column:execution_domain"` + Name string `gorm:"size:255;primary_key;column:execution_name"` + } + + type Execution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + ExecutionKey + LaunchPlanID uint `gorm:"index"` + WorkflowID uint `gorm:"index"` + TaskID uint `gorm:"index"` + Phase string `gorm:"size:255"` + Closure []byte + Spec []byte `gorm:"not null"` + StartedAt *time.Time + // Corresponds to the CreatedAt field in the Execution closure. + // Prefixed with Execution to avoid clashes with gorm.Model CreatedAt + ExecutionCreatedAt *time.Time `gorm:"index:idx_executions_created_at"` + // Corresponds to the UpdatedAt field in the Execution closure + // Prefixed with Execution to avoid clashes with gorm.Model UpdatedAt + ExecutionUpdatedAt *time.Time + Duration time.Duration + // In the case of an aborted execution this string may be non-empty. + // It should be ignored for any other value of phase other than aborted. + AbortCause string `gorm:"size:255"` + // Corresponds to the execution mode used to trigger this execution + Mode int32 + // The "parent" execution (if there is one) that is related to this execution. + SourceExecutionID uint + // The parent node execution if this was launched by a node + ParentNodeExecutionID uint + // Cluster where execution was triggered + Cluster string `gorm:"size:255"` + // Offloaded location of inputs LiteralMap. These are the inputs evaluated and contain applied defaults. + InputsURI storage.DataReference + // User specified inputs. This map might be incomplete and not include defaults applied + UserInputsURI storage.DataReference + // Execution Error Kind. nullable + // TODO: This is a string representation of the enum ExecutionError.ErrorKind + ErrorKind *string `gorm:"size:10;index"` + // Execution Error Code nullable + // TODO: This is a string representation of the enum ExecutionError.code + ErrorCode *string `gorm:"size:100"` + // The user responsible for launching this execution. + // This is also stored in the spec but promoted as a column for filtering. + User string `gorm:"size:100;index"` + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"index;default:0"` + // The resource type of the entity used to launch the execution, one of 'launch_plan' or 'task' + // FIXME: By default a field without a gorm tag gets the default value for that type, which for strings + // is varchar(255). + LaunchEntity string `gorm:"size:100"` + } + + return tx.AutoMigrate(&Execution{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-taskexecution", + Migrate: func(tx *gorm.DB) error { + type TaskKey struct { + Project string `gorm:"size:64;primary_key"` + Domain string `gorm:"size:255;primary_key"` + Name string `gorm:"size:255;primary_key"` + Version string `gorm:"size:255;primary_key"` + } + type TaskExecutionKey struct { + TaskKey + Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"size:255;primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"size:255;primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"size:255;primary_key;index:idx_task_executions_exec;index"` + // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. + // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. + RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` + } + type TaskExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + TaskExecutionKey + Phase string `gorm:"size:255"` + PhaseVersion uint32 + InputURI string `gorm:"size:255"` + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was createdAt, not to be confused with gorm.Model.CreatedAt + TaskExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt + TaskExecutionUpdatedAt *time.Time + Duration time.Duration + // The child node executions (if any) launched by this task execution. + // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? + ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` + } + + return tx.AutoMigrate(&TaskExecution{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-nodeexecution", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:255;primary_key;column:execution_domain"` + Name string `gorm:"size:255;primary_key;column:execution_name"` + } + + type NodeExecutionKey struct { + ExecutionKey + NodeID string `gorm:"size:255;primary_key;index"` + } + type NodeExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + NodeExecutionKey + // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. + Phase string `gorm:"size:255"` + InputURI string `gorm:"size:255"` + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the NodeExecution closure + // Prefixed with NodeExecution to avoid clashes with gorm.Model CreatedAt + NodeExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the NodeExecution closure + // Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt + NodeExecutionUpdatedAt *time.Time + Duration time.Duration + // The task execution (if any) which launched this node execution. + // TO BE DEPRECATED - as we have now introduced ParentID + ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` + // The workflow execution (if any) which this node execution launched + LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` + // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. + DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` + // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. + InternalData []byte + NodeExecutionMetadata []byte + // Parent that spawned this node execution - value is empty for executions at level 0 + ParentID *uint `sql:"default:null" gorm:"index"` + // List of child node executions - for cases like Dynamic task, sub workflow, etc + ChildNodeExecutions []NodeExecution `gorm:"foreignKey:ParentID;references:ID"` + // Execution Error Kind. nullable, can be one of core.ExecutionError_ErrorKind + ErrorKind *string `gorm:"size:255;index"` + // Execution Error Code nullable. string value, but finite set determined by the execution engine and plugins + ErrorCode *string `gorm:"size:255"` + // If the node is of Type Task, this should always exist for a successful execution, indicating the cache status for the execution + CacheStatus *string `gorm:"size:255"` + } + + return tx.AutoMigrate(&NodeExecution{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-execution-event", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:255;primary_key;column:execution_domain"` + Name string `gorm:"size:255;primary_key;column:execution_name"` + } + type ExecutionEvent struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + ExecutionKey + RequestID string `gorm:"size:255"` + OccurredAt time.Time `gorm:"type:time"` + Phase string `gorm:"size:255;primary_key"` + } + + return tx.AutoMigrate(&ExecutionEvent{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-node-execution-event", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:255;primary_key;column:execution_domain"` + Name string `gorm:"size:255;primary_key;column:execution_name"` + } + type NodeExecutionKey struct { + ExecutionKey + NodeID string `gorm:"size:180;primary_key;index"` + } + type NodeExecutionEvent struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + NodeExecutionKey + RequestID string `gorm:"size:255"` + OccurredAt time.Time + Phase string `gorm:"size:255;primary_key"` + } + + return tx.AutoMigrate(&NodeExecutionEvent{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-description-entity", + Migrate: func(tx *gorm.DB) error { + type DescriptionEntityKey struct { + // ResourceType is an enum that indicates the type of the resource. We represent it as an uint32. + ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx"` + Project string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx"` + Domain string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx"` + Name string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx"` + Version string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx"` + } + + // SourceCode Database model to encapsulate a SourceCode. + type SourceCode struct { + Link string `gorm:"size:255"` + } + + // DescriptionEntity Database model to encapsulate a DescriptionEntity. + type DescriptionEntity struct { + DescriptionEntityKey + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + SourceCode + ShortDescription string `gorm:"size:255"` + LongDescription []byte + } + + return tx.AutoMigrate(&DescriptionEntity{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-signal", + Migrate: func(tx *gorm.DB) error { + type SignalKey struct { + ExecutionKey + SignalID string `gorm:"size:255;primary_key;index"` + } + + type Signal struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + SignalKey + Type []byte `gorm:"not null"` + Value []byte + } + + return tx.AutoMigrate(&Signal{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-resource", + Migrate: func(tx *gorm.DB) error { + type ResourcePriority int32 + + // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique + type Resource struct { + ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time `sql:"index"` + Project string `gorm:"size:64;uniqueIndex:resource_idx"` + Domain string `gorm:"size:255;uniqueIndex:resource_idx""` + Workflow string `gorm:"size:255;uniqueIndex:resource_idx""` + LaunchPlan string `gorm:"size:255;uniqueIndex:resource_idx""` + ResourceType string `gorm:"size:255;uniqueIndex:resource_idx""` + Priority ResourcePriority + // Serialized flyteidl.admin.MatchingAttributes. + Attributes []byte + } + + return tx.AutoMigrate(&Resource{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-schedulable_entities", + Migrate: func(tx *gorm.DB) error { + type SchedulableEntityKey struct { + Project string `gorm:"size:64;primary_key"` + Domain string `gorm:"size:255;primary_key"` + Name string `gorm:"size:255;primary_key"` + Version string `gorm:"size:255;primary_key"` + } + type SchedulableEntity struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time `gorm:"index"` + SchedulableEntityKey + // TODO: figure out if this is just the schedule definition. + CronExpression string `gorm:"size:100"` + FixedRateValue uint32 + Unit admin.FixedRateUnit + // TODO: figure out how big this should be. + KickoffTimeInputArg string `gorm:"size:100"` + Active *bool + } + + return tx.AutoMigrate(&SchedulableEntity{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + { + ID: "2023-03-31-fixup-schedulable_entities-snapshot", + Migrate: func(tx *gorm.DB) error { + type ScheduleEntitiesSnapshot struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time `gorm:"index"` + Snapshot []byte `gorm:"column:snapshot" schema:"-"` + } + + return tx.AutoMigrate(&ScheduleEntitiesSnapshot{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, +} + +func ListMigrations(db *gorm.DB) []*gormigrate.Migration { + var Migrations []*gormigrate.Migration + // Only run legacy migrations for postgres + if db.Dialector.Name() == "postgres" { + Migrations = append(LegacyMigrations, NoopMigrations...) + } + Migrations = append(Migrations, FixupMigrations...) + return Migrations +} + func alterTableColumnType(db *sql.DB, columnName, columnType string) error { var err error diff --git a/pkg/server/initialize.go b/pkg/server/initialize.go index 3cc66a2ac..02367f4dd 100644 --- a/pkg/server/initialize.go +++ b/pkg/server/initialize.go @@ -43,8 +43,7 @@ func withDB(ctx context.Context, do func(db *gorm.DB) error) error { // Migrate runs all configured migrations func Migrate(ctx context.Context) error { return withDB(ctx, func(db *gorm.DB) error { - // TODO: filter out the migrations that shouldn't affect mysql. Use `db.Dialector.Name()` - m := gormigrate.New(db, gormigrate.DefaultOptions, config.Migrations) + m := gormigrate.New(db, gormigrate.DefaultOptions, config.ListMigrations(db)) if err := m.Migrate(); err != nil { return fmt.Errorf("database migration failed: %v", err) } @@ -56,7 +55,7 @@ func Migrate(ctx context.Context) error { // Rollback rolls back the last migration func Rollback(ctx context.Context) error { return withDB(ctx, func(db *gorm.DB) error { - m := gormigrate.New(db, gormigrate.DefaultOptions, config.Migrations) + m := gormigrate.New(db, gormigrate.DefaultOptions, config.ListMigrations(db)) err := m.RollbackLast() if err != nil { return fmt.Errorf("could not rollback latest migration: %v", err) From 0c9d2b497cf15761dda9529c8e924cec9d280baa Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Thu, 23 Mar 2023 12:57:03 -0700 Subject: [PATCH 09/37] Reapply migration changes. Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 40 ++++++++++++------- pkg/repositories/models/description_entity.go | 4 +- pkg/repositories/models/execution.go | 24 ++++++----- pkg/repositories/models/execution_event.go | 4 +- pkg/repositories/models/launch_plan.go | 11 ++--- pkg/repositories/models/named_entity.go | 6 +-- pkg/repositories/models/node_execution.go | 20 ++++++---- .../models/node_execution_event.go | 4 +- pkg/repositories/models/project.go | 6 +-- pkg/repositories/models/resource.go | 10 ++--- pkg/repositories/models/signal.go | 2 +- pkg/repositories/models/task.go | 12 +++--- pkg/repositories/models/task_execution.go | 6 ++- pkg/repositories/models/workflow.go | 5 ++- .../repositories/models/schedulable_entity.go | 6 ++- 15 files changed, 93 insertions(+), 67 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index d718d6b71..ed7cc05db 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -745,6 +745,7 @@ var NoopMigrations = []*gormigrate.Migration{ // TO BE DEPRECATED - as we have now introduced ParentID ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` // The workflow execution (if any) which this node execution launched + // FIXME: this is refering to a migration model (i.e. not inlined). LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. DynamicWorkflowRemoteClosureReference string @@ -1073,7 +1074,7 @@ var FixupMigrations = []*gormigrate.Migration{ CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` - ResourceType core.ResourceType `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Project string `gorm:"size:64;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Domain string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Name string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` @@ -1133,10 +1134,10 @@ var FixupMigrations = []*gormigrate.Migration{ // User specified inputs. This map might be incomplete and not include defaults applied UserInputsURI storage.DataReference // Execution Error Kind. nullable - // TODO: This is a string representation of the enum ExecutionError.ErrorKind + // FIXME: This is a string representation of the enum ExecutionError.ErrorKind ErrorKind *string `gorm:"size:10;index"` // Execution Error Code nullable - // TODO: This is a string representation of the enum ExecutionError.code + // FIXME: This is a string representation of the enum ExecutionError.code ErrorCode *string `gorm:"size:100"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. @@ -1225,7 +1226,9 @@ var FixupMigrations = []*gormigrate.Migration{ DeletedAt *time.Time `gorm:"index"` NodeExecutionKey // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. + // FIXME: how short should this be? Phase string `gorm:"size:255"` + // FIXME: how short should this be? InputURI string `gorm:"size:255"` Closure []byte StartedAt *time.Time @@ -1236,26 +1239,33 @@ var FixupMigrations = []*gormigrate.Migration{ // Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt NodeExecutionUpdatedAt *time.Time Duration time.Duration - // The task execution (if any) which launched this node execution. - // TO BE DEPRECATED - as we have now introduced ParentID - ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` - // The workflow execution (if any) which this node execution launched - LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` - // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. - DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` - // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. - InternalData []byte + // Metadata about the node execution. NodeExecutionMetadata []byte // Parent that spawned this node execution - value is empty for executions at level 0 ParentID *uint `sql:"default:null" gorm:"index"` // List of child node executions - for cases like Dynamic task, sub workflow, etc ChildNodeExecutions []NodeExecution `gorm:"foreignKey:ParentID;references:ID"` + // The task execution (if any) which launched this node execution. + // TO BE DEPRECATED - as we have now introduced ParentID + ParentTaskExecutionID *uint `sql:"default:null" gorm:"index"` + // The workflow execution (if any) which this node execution launched + // NOTE: LaunchedExecution[foreignkey:ParentNodeExecutionID] refers to Workflow execution launched and is different from ParentID + // FIXME: this is refering to a migration model (i.e. not inlined). + LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` // Execution Error Kind. nullable, can be one of core.ExecutionError_ErrorKind + // FIXME: how short should this be? ErrorKind *string `gorm:"size:255;index"` // Execution Error Code nullable. string value, but finite set determined by the execution engine and plugins + // FIXME: how short should this be? ErrorCode *string `gorm:"size:255"` // If the node is of Type Task, this should always exist for a successful execution, indicating the cache status for the execution + // FIXME: how short should this be? CacheStatus *string `gorm:"size:255"` + // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. + // FIXME: can this be this small? + DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` + // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. + InternalData []byte } return tx.AutoMigrate(&NodeExecution{}) @@ -1279,7 +1289,7 @@ var FixupMigrations = []*gormigrate.Migration{ DeletedAt *time.Time `gorm:"index"` ExecutionKey RequestID string `gorm:"size:255"` - OccurredAt time.Time `gorm:"type:time"` + OccurredAt time.Time Phase string `gorm:"size:255;primary_key"` } @@ -1419,11 +1429,11 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time DeletedAt *time.Time `gorm:"index"` SchedulableEntityKey - // TODO: figure out if this is just the schedule definition. + // FIXME: figure out if this is just the schedule definition. CronExpression string `gorm:"size:100"` FixedRateValue uint32 Unit admin.FixedRateUnit - // TODO: figure out how big this should be. + // FIXME: figure out how big this should be. KickoffTimeInputArg string `gorm:"size:100"` Active *bool } diff --git a/pkg/repositories/models/description_entity.go b/pkg/repositories/models/description_entity.go index c7290bca9..dc19aab6d 100644 --- a/pkg/repositories/models/description_entity.go +++ b/pkg/repositories/models/description_entity.go @@ -13,7 +13,7 @@ type DescriptionEntityKey struct { // SourceCode Database model to encapsulate a SourceCode. type SourceCode struct { - Link string `gorm:"size:100" valid:"length(0|255)"` + Link string `gorm:"size:255"` } // DescriptionEntity Database model to encapsulate a DescriptionEntity. @@ -24,7 +24,7 @@ type DescriptionEntity struct { SourceCode - ShortDescription string `gorm:"size:100` + ShortDescription string `gorm:"size:255"` LongDescription []byte } diff --git a/pkg/repositories/models/execution.go b/pkg/repositories/models/execution.go index 6b30e0eb1..4d1f4f4fb 100644 --- a/pkg/repositories/models/execution.go +++ b/pkg/repositories/models/execution.go @@ -11,9 +11,9 @@ import ( // Execution primary key type ExecutionKey struct { - Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:255;primary_key;column:execution_domain"` + Name string `gorm:"size:255;primary_key;column:execution_name"` } // Database model to encapsulate a (workflow) execution. @@ -23,7 +23,7 @@ type Execution struct { LaunchPlanID uint `gorm:"index"` WorkflowID uint `gorm:"index"` TaskID uint `gorm:"index"` - Phase string `valid:"length(0|255)"` + Phase string `gorm:"size:255"` Closure []byte Spec []byte `gorm:"not null"` StartedAt *time.Time @@ -36,7 +36,7 @@ type Execution struct { Duration time.Duration // In the case of an aborted execution this string may be non-empty. // It should be ignored for any other value of phase other than aborted. - AbortCause string `valid:"length(0|255)"` + AbortCause string `gorm:"size:255"` // Corresponds to the execution mode used to trigger this execution Mode int32 // The "parent" execution (if there is one) that is related to this execution. @@ -44,20 +44,24 @@ type Execution struct { // The parent node execution if this was launched by a node ParentNodeExecutionID uint // Cluster where execution was triggered - Cluster string `valid:"length(0|255)"` + Cluster string `gorm:"size:255"` // Offloaded location of inputs LiteralMap. These are the inputs evaluated and contain applied defaults. InputsURI storage.DataReference // User specified inputs. This map might be incomplete and not include defaults applied UserInputsURI storage.DataReference // Execution Error Kind. nullable - ErrorKind *string `gorm:"index"` + // TODO: This is a string representation of the enum ExecutionError.ErrorKind + ErrorKind *string `gorm:"size:10;index"` // Execution Error Code nullable - ErrorCode *string `valid:"length(0|255)"` + // TODO: This is a string representation of the enum ExecutionError.code + ErrorCode *string `gorm:"size:100"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. - User string `gorm:"index" valid:"length(0|255)"` + User string `gorm:"size:100;index"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field State *int32 `gorm:"index;default:0"` // The resource type of the entity used to launch the execution, one of 'launch_plan' or 'task' - LaunchEntity string + // FIXME: By default a field without a gorm tag gets the default value for that type, which for strings + // is varchar(255). + LaunchEntity string `gorm:"size:100"` } diff --git a/pkg/repositories/models/execution_event.go b/pkg/repositories/models/execution_event.go index b6e18decc..6e4685446 100644 --- a/pkg/repositories/models/execution_event.go +++ b/pkg/repositories/models/execution_event.go @@ -7,7 +7,7 @@ import ( type ExecutionEvent struct { BaseModel ExecutionKey - RequestID string `valid:"length(0|255)"` + RequestID string `gorm:"size:255"` OccurredAt time.Time - Phase string `gorm:"primary_key"` + Phase string `gorm:"size:255;primary_key"` } diff --git a/pkg/repositories/models/launch_plan.go b/pkg/repositories/models/launch_plan.go index 2b2787518..6afa5534a 100644 --- a/pkg/repositories/models/launch_plan.go +++ b/pkg/repositories/models/launch_plan.go @@ -1,6 +1,7 @@ package models // Launch plan primary key +// TODO: Add size constraints to the fields type LaunchPlanKey struct { Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` @@ -23,12 +24,12 @@ const ( type LaunchPlan struct { BaseModel LaunchPlanKey - Spec []byte `gorm:"not null"` - WorkflowID uint `gorm:"index"` - Closure []byte `gorm:"not null"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` + State *int32 `gorm:"default:0"` // Hash of the launch plan Digest []byte - ScheduleType LaunchPlanScheduleType + ScheduleType LaunchPlanScheduleType `gorm:"size:255"` } diff --git a/pkg/repositories/models/named_entity.go b/pkg/repositories/models/named_entity.go index 966676d0c..ff3b33368 100644 --- a/pkg/repositories/models/named_entity.go +++ b/pkg/repositories/models/named_entity.go @@ -7,9 +7,9 @@ import ( // NamedEntityMetadata primary key type NamedEntityMetadataKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Project string `gorm:"size:64;primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Domain string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Name string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` } // Fields to be composed into any named entity diff --git a/pkg/repositories/models/node_execution.go b/pkg/repositories/models/node_execution.go index f45c8caec..b88312cab 100644 --- a/pkg/repositories/models/node_execution.go +++ b/pkg/repositories/models/node_execution.go @@ -9,7 +9,7 @@ import ( type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:180;primary_key;index" valid:"length(0|180)"` + NodeID string `gorm:"size:255;primary_key;index"` } // By convention, gorm foreign key references are of the form {ModelName}ID @@ -17,8 +17,10 @@ type NodeExecution struct { BaseModel NodeExecutionKey // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. - Phase string - InputURI string + // FIXME: how short should this be? + Phase string `gorm:"size:255"` + // FIXME: how short should this be? + InputURI string `gorm:"size:255"` Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the NodeExecution closure @@ -41,13 +43,17 @@ type NodeExecution struct { // NOTE: LaunchedExecution[foreignkey:ParentNodeExecutionID] refers to Workflow execution launched and is different from ParentID LaunchedExecution Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` // Execution Error Kind. nullable, can be one of core.ExecutionError_ErrorKind - ErrorKind *string `gorm:"index"` + // FIXME: how short should this be? + ErrorKind *string `gorm:"size:255;index"` // Execution Error Code nullable. string value, but finite set determined by the execution engine and plugins - ErrorCode *string + // FIXME: how short should this be? + ErrorCode *string `gorm:"size:255"` // If the node is of Type Task, this should always exist for a successful execution, indicating the cache status for the execution - CacheStatus *string + // FIXME: how short should this be? + CacheStatus *string `gorm:"size:255"` // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. - DynamicWorkflowRemoteClosureReference string + // FIXME: can this be this small? + DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. InternalData []byte } diff --git a/pkg/repositories/models/node_execution_event.go b/pkg/repositories/models/node_execution_event.go index 550540231..1a4600a74 100644 --- a/pkg/repositories/models/node_execution_event.go +++ b/pkg/repositories/models/node_execution_event.go @@ -7,7 +7,7 @@ import ( type NodeExecutionEvent struct { BaseModel NodeExecutionKey - RequestID string + RequestID string `gorm:"size:255"` OccurredAt time.Time - Phase string `gorm:"size:128;primary_key"` + Phase string `gorm:"size:255;primary_key"` } diff --git a/pkg/repositories/models/project.go b/pkg/repositories/models/project.go index a5feedb27..9cbdbb42c 100644 --- a/pkg/repositories/models/project.go +++ b/pkg/repositories/models/project.go @@ -2,9 +2,9 @@ package models type Project struct { BaseModel - Identifier string `gorm:"primary_key"` - Name string `valid:"length(0|255)"` // Human-readable name, not a unique identifier. - Description string `gorm:"type:varchar(300)"` + Identifier string `gorm:"primary_key"` + Name string `gorm:"size:64"` // Human-readable name, not a unique identifier. + Description string `gorm:"type:varchar(300)"` Labels []byte // GORM doesn't save the zero value for ints, so we use a pointer for the State field State *int32 `gorm:"default:0;index"` diff --git a/pkg/repositories/models/resource.go b/pkg/repositories/models/resource.go index ae91919dd..a13ca5fab 100644 --- a/pkg/repositories/models/resource.go +++ b/pkg/repositories/models/resource.go @@ -18,11 +18,11 @@ type Resource struct { CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Project string `gorm:"size:64;uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte diff --git a/pkg/repositories/models/signal.go b/pkg/repositories/models/signal.go index 8a7fac693..af21bd487 100644 --- a/pkg/repositories/models/signal.go +++ b/pkg/repositories/models/signal.go @@ -3,7 +3,7 @@ package models // Signal primary key type SignalKey struct { ExecutionKey - SignalID string `gorm:"primary_key;index" valid:"length(0|255)"` + SignalID string `gorm:"size:255;primary_key;index"` } // Database model to encapsulate a signal. diff --git a/pkg/repositories/models/task.go b/pkg/repositories/models/task.go index 3a8ca9fa9..cb2c8f4a5 100644 --- a/pkg/repositories/models/task.go +++ b/pkg/repositories/models/task.go @@ -6,20 +6,20 @@ package models // Task primary key type TaskKey struct { Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"size:100;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"size:100;primary_key" valid:"length(0|255)"` + Domain string `gorm:"size:255;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"size:255;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"size:255;primary_key" valid:"length(0|255)"` } // Database model to encapsulate a task. type Task struct { BaseModel TaskKey - Closure []byte `gorm:"not null"` + Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"size:100" valid:"length(0|255)"` + Type string `gorm:"size:255"` // ShortDescription for the task. - ShortDescription string `gorm:"size:100"` + ShortDescription string `gorm:"size:255"` } diff --git a/pkg/repositories/models/task_execution.go b/pkg/repositories/models/task_execution.go index 1f5717481..5c2edd8b1 100644 --- a/pkg/repositories/models/task_execution.go +++ b/pkg/repositories/models/task_execution.go @@ -15,6 +15,7 @@ type TaskExecutionKey struct { NodeExecutionKey // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. + // TODO: why isn't AUTO_INCREMENT:FALSE not here? RetryAttempt *uint32 `gorm:"primary_key"` } @@ -22,9 +23,9 @@ type TaskExecutionKey struct { type TaskExecution struct { BaseModel TaskExecutionKey - Phase string `valid:"length(0|255)"` + Phase string `gorm:"size:255"` PhaseVersion uint32 - InputURI string `valid:"length(0|255)"` + InputURI string `gorm:"size:255"` Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the TaskExecution closure @@ -37,5 +38,6 @@ type TaskExecution struct { TaskExecutionUpdatedAt *time.Time Duration time.Duration // The child node executions (if any) launched by this task execution. + // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` } diff --git a/pkg/repositories/models/workflow.go b/pkg/repositories/models/workflow.go index f431c47b3..a595a884c 100644 --- a/pkg/repositories/models/workflow.go +++ b/pkg/repositories/models/workflow.go @@ -1,6 +1,7 @@ package models // Workflow primary key +// TODO: Add size to the fields type WorkflowKey struct { Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` @@ -13,9 +14,9 @@ type Workflow struct { BaseModel WorkflowKey TypedInterface []byte - RemoteClosureIdentifier string `gorm:"not null" valid:"length(0|255)"` + RemoteClosureIdentifier string `gorm:"size:255;not null"` // Hash of the compiled workflow closure Digest []byte // ShortDescription for the workflow. - ShortDescription string + ShortDescription string `gorm:"size:255"` } diff --git a/scheduler/repositories/models/schedulable_entity.go b/scheduler/repositories/models/schedulable_entity.go index 550a2292a..e1d10f3c3 100644 --- a/scheduler/repositories/models/schedulable_entity.go +++ b/scheduler/repositories/models/schedulable_entity.go @@ -9,10 +9,12 @@ import ( type SchedulableEntity struct { models.BaseModel SchedulableEntityKey - CronExpression string + // FIXME: figure out if this is just the schedule definition. + CronExpression string `gorm:"size:100"` FixedRateValue uint32 Unit admin.FixedRateUnit - KickoffTimeInputArg string + // FIXME: figure out how big this should be. + KickoffTimeInputArg string `gorm:"size:100"` Active *bool } From 8808346a41d41f7767034e2e4bd45a909e55ba5f Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Thu, 23 Mar 2023 17:54:59 -0700 Subject: [PATCH 10/37] Remove old cruft Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 435 +-------------------- pkg/repositories/config/migrations_test.go | 2 +- 2 files changed, 12 insertions(+), 425 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index ed7cc05db..d3ec4d09d 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -205,26 +205,13 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Exec("UPDATE named_entity_metadata set state = NULL").Error }, }, - // FIXME: the syntax ALTER TABLE T DROP COLUMN IF EXISTS c is invalid in mysql. - // TODO: remove mentions to that from other queries ((including rollbacks)) // Modify the workflows table, if necessary { ID: "2020-04-03-workflow-state", Migrate: func(tx *gorm.DB) error { - if !tx.Model(&models.Workflow{}).Migrator().HasColumn(&models.Workflow{}, "state") { - return nil - } - if err := tx.Model(&models.Workflow{}).Migrator().DropColumn(&models.Workflow{}, "state"); err != nil { - return err - } - return nil + return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS state").Error }, Rollback: func(tx *gorm.DB) error { - // TODO: the column state is not going to be present in the model. Does this mean that we cannot - // rely on gorm to restore the column? - // if err := tx.Model(&models.Workflow{}).Migrator().AddColumn(&models.Workflow{}, "state"); err != nil { - // return err - // } return tx.Exec("ALTER TABLE workflows ADD COLUMN IF NOT EXISTS state integer;").Error }, }, @@ -357,17 +344,17 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Migrator().DropTable(&schedulerModels.ScheduleEntitiesSnapshot{}, "schedulable_entities_snapshot") }, }, + // For any new table, Please use the following pattern due to a bug // in the postgres gorm layer https://github.com/go-gorm/postgres/issues/65 { ID: "2022-01-11-id-to-bigint", Migrate: func(tx *gorm.DB) error { - return nil - // db, err := tx.DB() - // if err != nil { - // return err - // } - // return alterTableColumnType(db, "id", "bigint") + db, err := tx.DB() + if err != nil { + return err + } + return alterTableColumnType(db, "id", "bigint") }, Rollback: func(tx *gorm.DB) error { db, err := tx.DB() @@ -418,7 +405,7 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Migrator().DropTable("description_entities") }, }, - // // Modify the tasks table, if necessary + // Modify the tasks table, if necessary { ID: "2020-09-13-task-short_description", Migrate: func(tx *gorm.DB) error { @@ -438,7 +425,7 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS short_description").Error }, }, - // // Create signals table. + // Create signals table. { ID: "2022-04-11-signals", Migrate: func(tx *gorm.DB) error { @@ -1477,410 +1464,10 @@ func alterTableColumnType(db *sql.DB, columnName, columnType string) error { var err error for _, table := range tables { - // if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, - // columnType)); err != nil { - // return err - // } - // TODO: figure out how to get the driver name - if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE %s MODIFY COLUMN %s %s`, table, columnName, columnType)); err != nil { + if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, + columnType)); err != nil { return err } } return nil } - -// func alterTableColumnTypeGorm(tx *gorm.DB, columnName, columnType string) error { -// for tableName, model := range gorm_models { -// if tx.Model(model).Migrator().HasColumn(model, "columnName") { -// tx.Migrator().MigrateColumn(model, field *schema.Field, columnType gorm.ColumnType) -// } -// } -// } - -var Migrations = []*gormigrate.Migration{ - /* The following is a series of Postgres specific migrations. They should mirror the state - of the database as of 2023 March. The rollback is a noop for everything because the migration itself should - be a noop. - */ - // need to add not null, re-running old migrations now seems to drop the not null constraint on ID. - - { - ID: "pg-noop-2023-03-31-noop-project-3", - Migrate: func(tx *gorm.DB) error { - type Project struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Identifier string `gorm:"primary_key"` - Name string `valid:"length(0|255)"` // Human-readable name, not a unique identifier. - Description string `gorm:"type:varchar(300)"` - Labels []byte - // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0;index"` - } - return tx.AutoMigrate(&Project{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - // ALTER TABLE "projects" ALTER COLUMN "id" DROP NOT NULL otherwise. - - { - ID: "pg-noop-2023-03-31-noop-task-2", - Migrate: func(tx *gorm.DB) error { - type Task struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key" valid:"length(0|255)"` - Closure []byte `gorm:"not null"` - // Hash of the compiled task closure - Digest []byte - // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"" valid:"length(0|255)"` - // ShortDescription for the task. - ShortDescription string - } - return tx.AutoMigrate(&Task{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-workflow", - Migrate: func(tx *gorm.DB) error { - type Workflow struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key"` - TypedInterface []byte - RemoteClosureIdentifier string `gorm:"not null" valid:"length(0|255)"` - // Hash of the compiled workflow closure - Digest []byte - // ShortDescription for the workflow. - ShortDescription string - } - return tx.AutoMigrate(&Workflow{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-launchplan", - Migrate: func(tx *gorm.DB) error { - type LaunchPlanScheduleType string - - const ( - LaunchPlanScheduleTypeNONE LaunchPlanScheduleType = "NONE" - LaunchPlanScheduleTypeCRON LaunchPlanScheduleType = "CRON" - LaunchPlanScheduleTypeRATE LaunchPlanScheduleType = "RATE" - ) - - type LaunchPlan struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:lp_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key" valid:"length(0|255)"` - Spec []byte `gorm:"not null"` - WorkflowID uint `gorm:"index"` - Closure []byte `gorm:"not null"` - // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` - // Hash of the launch plan - Digest []byte - ScheduleType LaunchPlanScheduleType - } - return tx.AutoMigrate(&LaunchPlan{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-namedentitymetadata", - Migrate: func(tx *gorm.DB) error { - type NamedEntityMetadata struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Description string `gorm:"type:varchar(300)"` - // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` - } - - return tx.AutoMigrate(&NamedEntityMetadata{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-taskexecution-3", - Migrate: func(tx *gorm.DB) error { - type TaskKey struct { - Project string `gorm:"primary_key"` - Domain string `gorm:"primary_key"` - Name string `gorm:"primary_key"` - Version string `gorm:"primary_key"` - } - type TaskExecutionKey struct { - TaskKey - Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` - // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. - // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. - RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` - } - type TaskExecution struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - TaskExecutionKey - Phase string `gorm:"type:text"` - PhaseVersion uint32 - InputURI string `gorm:"type:text"` - Closure []byte - StartedAt *time.Time - // Corresponds to the CreatedAt field in the TaskExecution closure - // This field is prefixed with TaskExecution because it signifies when - // the execution was createdAt, not to be confused with gorm.Model.CreatedAt - TaskExecutionCreatedAt *time.Time - // Corresponds to the UpdatedAt field in the TaskExecution closure - // This field is prefixed with TaskExecution because it signifies when - // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt - TaskExecutionUpdatedAt *time.Time - Duration time.Duration - // The child node executions (if any) launched by this task execution. - ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` - } - - return tx.AutoMigrate(&TaskExecution{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - // ALTER TABLE "task_executions" ALTER COLUMN "phase" TYPE varchar(100) USING "phase"::varchar(100) - // ALTER TABLE "task_executions" ALTER COLUMN "input_uri" TYPE varchar(100) USING "input_uri"::varchar(100) - - { - ID: "pg-noop-2023-03-31-noop-nodeexecution-2", - Migrate: func(tx *gorm.DB) error { - type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project"` - Domain string `gorm:"primary_key;column:execution_domain"` - Name string `gorm:"primary_key;column:execution_name"` - } - - type NodeExecutionKey struct { - ExecutionKey - NodeID string `gorm:"primary_key;index"` - } - type NodeExecution struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - NodeExecutionKey - // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. - Phase string - InputURI string - Closure []byte - StartedAt *time.Time - // Corresponds to the CreatedAt field in the NodeExecution closure - // Prefixed with NodeExecution to avoid clashes with gorm.Model CreatedAt - NodeExecutionCreatedAt *time.Time - // Corresponds to the UpdatedAt field in the NodeExecution closure - // Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt - NodeExecutionUpdatedAt *time.Time - Duration time.Duration - // The task execution (if any) which launched this node execution. - ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` - // The workflow execution (if any) which this node execution launched - LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` - // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. - DynamicWorkflowRemoteClosureReference string - // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. - InternalData []byte - } - - return tx.AutoMigrate(&NodeExecution{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-execution-event", - Migrate: func(tx *gorm.DB) error { - type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` - } - type ExecutionEvent struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - ExecutionKey - RequestID string `valid:"length(0|255)"` - OccurredAt time.Time - Phase string `gorm:"primary_key"` - } - - return tx.AutoMigrate(&ExecutionEvent{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-node-execution-event", - Migrate: func(tx *gorm.DB) error { - type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` - } - type NodeExecutionKey struct { - ExecutionKey - NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` - } - type NodeExecutionEvent struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - NodeExecutionKey - RequestID string - OccurredAt time.Time - Phase string `gorm:"primary_key"` - } - - return tx.AutoMigrate(&NodeExecutionEvent{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-description-entity-2", - Migrate: func(tx *gorm.DB) error { - type DescriptionEntityKey struct { - ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - } - - // SourceCode Database model to encapsulate a SourceCode. - type SourceCode struct { - Link string `valid:"length(0|255)"` - } - - // DescriptionEntity Database model to encapsulate a DescriptionEntity. - type DescriptionEntity struct { - DescriptionEntityKey - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - SourceCode - ShortDescription string - LongDescription []byte - } - - return tx.AutoMigrate(&DescriptionEntity{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-signal", - Migrate: func(tx *gorm.DB) error { - type SignalKey struct { - ExecutionKey - SignalID string `gorm:"primary_key;index" valid:"length(0|255)"` - } - - type Signal struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - SignalKey - Type []byte `gorm:"not null"` - Value []byte - } - - return tx.AutoMigrate(&Signal{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-resource-3", - Migrate: func(tx *gorm.DB) error { - type ResourcePriority int32 - - // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique - type Resource struct { - ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` - CreatedAt time.Time - UpdatedAt time.Time - DeletedAt *time.Time `sql:"index"` - Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Priority ResourcePriority - // Serialized flyteidl.admin.MatchingAttributes. - Attributes []byte - } - - return tx.AutoMigrate(&Resource{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, -} diff --git a/pkg/repositories/config/migrations_test.go b/pkg/repositories/config/migrations_test.go index 6d43420a7..a5a135017 100644 --- a/pkg/repositories/config/migrations_test.go +++ b/pkg/repositories/config/migrations_test.go @@ -71,7 +71,7 @@ func TestMigrations(t *testing.T) { fmt.Println(gormDb) - m := gormigrate.New(gormDb, gormigrate.DefaultOptions, Migrations) + m := gormigrate.New(gormDb, gormigrate.DefaultOptions, ListMigrations(gormDb)) if err := m.Migrate(); err != nil { fmt.Errorf("database migration failed: %v", err) } From 4a1f80a042cdf8c07ceff306d655ba726287d054 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Thu, 23 Mar 2023 18:20:42 -0700 Subject: [PATCH 11/37] Remove gorm changes from migration_models.go Signed-off-by: eduardo apolinario --- pkg/repositories/config/migration_models.go | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/repositories/config/migration_models.go b/pkg/repositories/config/migration_models.go index 37b1d2c18..4c0144697 100644 --- a/pkg/repositories/config/migration_models.go +++ b/pkg/repositories/config/migration_models.go @@ -16,21 +16,21 @@ import ( */ type TaskKey struct { - Project string `gorm:"size:64;primary_key"` - Domain string `gorm:"size:100;primary_key"` - Name string `gorm:"size:100;primary_key"` - Version string `gorm:"size:100;primary_key"` + Project string `gorm:"primary_key"` + Domain string `gorm:"primary_key"` + Name string `gorm:"primary_key"` + Version string `gorm:"primary_key"` } type ExecutionKey struct { - Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:100;primary_key;column:execution_domain"` - Name string `gorm:"size:100;primary_key;column:execution_name"` + Project string `gorm:"primary_key;column:execution_project"` + Domain string `gorm:"primary_key;column:execution_domain"` + Name string `gorm:"primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:100;primary_key;index"` + NodeID string `gorm:"primary_key;index"` } type NodeExecution struct { @@ -60,10 +60,10 @@ type NodeExecution struct { type TaskExecutionKey struct { TaskKey - Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"size:100;primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"size:100;primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"size:100;primary_key;index:idx_task_executions_exec;index"` + Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` @@ -72,9 +72,9 @@ type TaskExecutionKey struct { type TaskExecution struct { models.BaseModel TaskExecutionKey - Phase string `gorm:"size:100"` + Phase string PhaseVersion uint32 - InputURI string `gorm:"size:100"` + InputURI string Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the TaskExecution closure From 7a43adbad9bfb1b4cdd5dec2576af0f07b1719ca Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Thu, 23 Mar 2023 18:49:11 -0700 Subject: [PATCH 12/37] One more pass in setting size constraints Signed-off-by: eduardo apolinario --- pkg/repositories/models/description_entity.go | 12 ++++++------ pkg/repositories/models/execution.go | 4 ++-- pkg/repositories/models/launch_plan.go | 8 ++++---- pkg/repositories/models/task.go | 4 ++-- pkg/repositories/models/task_execution.go | 3 --- pkg/repositories/models/workflow.go | 12 ++++++------ scheduler/repositories/models/schedulable_entity.go | 8 ++++---- 7 files changed, 24 insertions(+), 27 deletions(-) diff --git a/pkg/repositories/models/description_entity.go b/pkg/repositories/models/description_entity.go index dc19aab6d..05d9f027f 100644 --- a/pkg/repositories/models/description_entity.go +++ b/pkg/repositories/models/description_entity.go @@ -5,10 +5,10 @@ import "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" // DescriptionEntityKey DescriptionEntity primary key type DescriptionEntityKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` } // SourceCode Database model to encapsulate a SourceCode. @@ -22,9 +22,9 @@ type DescriptionEntity struct { BaseModel - SourceCode - ShortDescription string `gorm:"size:255"` LongDescription []byte + + SourceCode } diff --git a/pkg/repositories/models/execution.go b/pkg/repositories/models/execution.go index 4d1f4f4fb..2d362b771 100644 --- a/pkg/repositories/models/execution.go +++ b/pkg/repositories/models/execution.go @@ -50,10 +50,10 @@ type Execution struct { // User specified inputs. This map might be incomplete and not include defaults applied UserInputsURI storage.DataReference // Execution Error Kind. nullable - // TODO: This is a string representation of the enum ExecutionError.ErrorKind + // FIXME: This is a string representation of the enum ExecutionError.ErrorKind ErrorKind *string `gorm:"size:10;index"` // Execution Error Code nullable - // TODO: This is a string representation of the enum ExecutionError.code + // FIXME: This is a string representation of the enum ExecutionError.code ErrorCode *string `gorm:"size:100"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. diff --git a/pkg/repositories/models/launch_plan.go b/pkg/repositories/models/launch_plan.go index 6afa5534a..f48aeb327 100644 --- a/pkg/repositories/models/launch_plan.go +++ b/pkg/repositories/models/launch_plan.go @@ -24,11 +24,11 @@ const ( type LaunchPlan struct { BaseModel LaunchPlanKey - Spec []byte `gorm:"not null"` - WorkflowID uint `gorm:"index"` - Closure []byte `gorm:"not null"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` + State *int32 `gorm:"default:0"` // Hash of the launch plan Digest []byte ScheduleType LaunchPlanScheduleType `gorm:"size:255"` diff --git a/pkg/repositories/models/task.go b/pkg/repositories/models/task.go index cb2c8f4a5..aa693e990 100644 --- a/pkg/repositories/models/task.go +++ b/pkg/repositories/models/task.go @@ -15,11 +15,11 @@ type TaskKey struct { type Task struct { BaseModel TaskKey - Closure []byte `gorm:"not null"` + Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"size:255"` + Type string `gorm:"size:255"` // ShortDescription for the task. ShortDescription string `gorm:"size:255"` } diff --git a/pkg/repositories/models/task_execution.go b/pkg/repositories/models/task_execution.go index 5c2edd8b1..407970cbc 100644 --- a/pkg/repositories/models/task_execution.go +++ b/pkg/repositories/models/task_execution.go @@ -6,8 +6,6 @@ import ( // IMPORTANT: If you update the model below, be sure to double check model definitions in // pkg/repositories/config/migration_models.go -// -// TODO: why do we have copies of the models present in this file in pkg/repositories/config/migration_models.go? // Task execution primary key type TaskExecutionKey struct { @@ -38,6 +36,5 @@ type TaskExecution struct { TaskExecutionUpdatedAt *time.Time Duration time.Duration // The child node executions (if any) launched by this task execution. - // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` } diff --git a/pkg/repositories/models/workflow.go b/pkg/repositories/models/workflow.go index a595a884c..42067913a 100644 --- a/pkg/repositories/models/workflow.go +++ b/pkg/repositories/models/workflow.go @@ -3,10 +3,10 @@ package models // Workflow primary key // TODO: Add size to the fields type WorkflowKey struct { - Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key"` + Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"size:255;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"size:255;primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"size:255;primary_key"` } // Database model to encapsulate a workflow. @@ -14,9 +14,9 @@ type Workflow struct { BaseModel WorkflowKey TypedInterface []byte - RemoteClosureIdentifier string `gorm:"size:255;not null"` + RemoteClosureIdentifier string `gorm:"size:255;not null"` // Hash of the compiled workflow closure Digest []byte // ShortDescription for the workflow. - ShortDescription string `gorm:"size:255"` + ShortDescription string `gorm:"size:255"` } diff --git a/scheduler/repositories/models/schedulable_entity.go b/scheduler/repositories/models/schedulable_entity.go index e1d10f3c3..5b226db8e 100644 --- a/scheduler/repositories/models/schedulable_entity.go +++ b/scheduler/repositories/models/schedulable_entity.go @@ -20,8 +20,8 @@ type SchedulableEntity struct { // Schedulable entity primary key type SchedulableEntityKey struct { - Project string `gorm:"primary_key"` - Domain string `gorm:"primary_key"` - Name string `gorm:"primary_key"` - Version string `gorm:"primary_key"` + Project string `gorm:"size:64;primary_key"` + Domain string `gorm:"size:255;primary_key"` + Name string `gorm:"size:255;primary_key"` + Version string `gorm:"size:255;primary_key"` } From 31f0bff85fd3f775471ac62bc247750bd12f9271 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Fri, 24 Mar 2023 13:20:37 -0700 Subject: [PATCH 13/37] Revert "One more pass in setting size constraints" This reverts commit 7a43adbad9bfb1b4cdd5dec2576af0f07b1719ca. Signed-off-by: Eduardo Apolinario --- pkg/repositories/models/description_entity.go | 12 ++++++------ pkg/repositories/models/execution.go | 4 ++-- pkg/repositories/models/launch_plan.go | 8 ++++---- pkg/repositories/models/task.go | 4 ++-- pkg/repositories/models/task_execution.go | 3 +++ pkg/repositories/models/workflow.go | 12 ++++++------ scheduler/repositories/models/schedulable_entity.go | 8 ++++---- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/pkg/repositories/models/description_entity.go b/pkg/repositories/models/description_entity.go index 05d9f027f..dc19aab6d 100644 --- a/pkg/repositories/models/description_entity.go +++ b/pkg/repositories/models/description_entity.go @@ -5,10 +5,10 @@ import "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" // DescriptionEntityKey DescriptionEntity primary key type DescriptionEntityKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` } // SourceCode Database model to encapsulate a SourceCode. @@ -22,9 +22,9 @@ type DescriptionEntity struct { BaseModel + SourceCode + ShortDescription string `gorm:"size:255"` LongDescription []byte - - SourceCode } diff --git a/pkg/repositories/models/execution.go b/pkg/repositories/models/execution.go index 2d362b771..4d1f4f4fb 100644 --- a/pkg/repositories/models/execution.go +++ b/pkg/repositories/models/execution.go @@ -50,10 +50,10 @@ type Execution struct { // User specified inputs. This map might be incomplete and not include defaults applied UserInputsURI storage.DataReference // Execution Error Kind. nullable - // FIXME: This is a string representation of the enum ExecutionError.ErrorKind + // TODO: This is a string representation of the enum ExecutionError.ErrorKind ErrorKind *string `gorm:"size:10;index"` // Execution Error Code nullable - // FIXME: This is a string representation of the enum ExecutionError.code + // TODO: This is a string representation of the enum ExecutionError.code ErrorCode *string `gorm:"size:100"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. diff --git a/pkg/repositories/models/launch_plan.go b/pkg/repositories/models/launch_plan.go index f48aeb327..6afa5534a 100644 --- a/pkg/repositories/models/launch_plan.go +++ b/pkg/repositories/models/launch_plan.go @@ -24,11 +24,11 @@ const ( type LaunchPlan struct { BaseModel LaunchPlanKey - Spec []byte `gorm:"not null"` - WorkflowID uint `gorm:"index"` - Closure []byte `gorm:"not null"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` + State *int32 `gorm:"default:0"` // Hash of the launch plan Digest []byte ScheduleType LaunchPlanScheduleType `gorm:"size:255"` diff --git a/pkg/repositories/models/task.go b/pkg/repositories/models/task.go index aa693e990..cb2c8f4a5 100644 --- a/pkg/repositories/models/task.go +++ b/pkg/repositories/models/task.go @@ -15,11 +15,11 @@ type TaskKey struct { type Task struct { BaseModel TaskKey - Closure []byte `gorm:"not null"` + Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"size:255"` + Type string `gorm:"size:255"` // ShortDescription for the task. ShortDescription string `gorm:"size:255"` } diff --git a/pkg/repositories/models/task_execution.go b/pkg/repositories/models/task_execution.go index 407970cbc..5c2edd8b1 100644 --- a/pkg/repositories/models/task_execution.go +++ b/pkg/repositories/models/task_execution.go @@ -6,6 +6,8 @@ import ( // IMPORTANT: If you update the model below, be sure to double check model definitions in // pkg/repositories/config/migration_models.go +// +// TODO: why do we have copies of the models present in this file in pkg/repositories/config/migration_models.go? // Task execution primary key type TaskExecutionKey struct { @@ -36,5 +38,6 @@ type TaskExecution struct { TaskExecutionUpdatedAt *time.Time Duration time.Duration // The child node executions (if any) launched by this task execution. + // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` } diff --git a/pkg/repositories/models/workflow.go b/pkg/repositories/models/workflow.go index 42067913a..a595a884c 100644 --- a/pkg/repositories/models/workflow.go +++ b/pkg/repositories/models/workflow.go @@ -3,10 +3,10 @@ package models // Workflow primary key // TODO: Add size to the fields type WorkflowKey struct { - Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"size:255;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"size:255;primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"size:255;primary_key"` + Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key"` } // Database model to encapsulate a workflow. @@ -14,9 +14,9 @@ type Workflow struct { BaseModel WorkflowKey TypedInterface []byte - RemoteClosureIdentifier string `gorm:"size:255;not null"` + RemoteClosureIdentifier string `gorm:"size:255;not null"` // Hash of the compiled workflow closure Digest []byte // ShortDescription for the workflow. - ShortDescription string `gorm:"size:255"` + ShortDescription string `gorm:"size:255"` } diff --git a/scheduler/repositories/models/schedulable_entity.go b/scheduler/repositories/models/schedulable_entity.go index 5b226db8e..e1d10f3c3 100644 --- a/scheduler/repositories/models/schedulable_entity.go +++ b/scheduler/repositories/models/schedulable_entity.go @@ -20,8 +20,8 @@ type SchedulableEntity struct { // Schedulable entity primary key type SchedulableEntityKey struct { - Project string `gorm:"size:64;primary_key"` - Domain string `gorm:"size:255;primary_key"` - Name string `gorm:"size:255;primary_key"` - Version string `gorm:"size:255;primary_key"` + Project string `gorm:"primary_key"` + Domain string `gorm:"primary_key"` + Name string `gorm:"primary_key"` + Version string `gorm:"primary_key"` } From b089e2717ad43ada9cfa8dd42d0032afe7cbd9f6 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Fri, 24 Mar 2023 13:24:29 -0700 Subject: [PATCH 14/37] Revert "Remove gorm changes from migration_models.go" This reverts commit 4a1f80a042cdf8c07ceff306d655ba726287d054. Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migration_models.go | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/repositories/config/migration_models.go b/pkg/repositories/config/migration_models.go index 4c0144697..37b1d2c18 100644 --- a/pkg/repositories/config/migration_models.go +++ b/pkg/repositories/config/migration_models.go @@ -16,21 +16,21 @@ import ( */ type TaskKey struct { - Project string `gorm:"primary_key"` - Domain string `gorm:"primary_key"` - Name string `gorm:"primary_key"` - Version string `gorm:"primary_key"` + Project string `gorm:"size:64;primary_key"` + Domain string `gorm:"size:100;primary_key"` + Name string `gorm:"size:100;primary_key"` + Version string `gorm:"size:100;primary_key"` } type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project"` - Domain string `gorm:"primary_key;column:execution_domain"` - Name string `gorm:"primary_key;column:execution_name"` + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:100;primary_key;column:execution_domain"` + Name string `gorm:"size:100;primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"primary_key;index"` + NodeID string `gorm:"size:100;primary_key;index"` } type NodeExecution struct { @@ -60,10 +60,10 @@ type NodeExecution struct { type TaskExecutionKey struct { TaskKey - Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` + Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"size:100;primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"size:100;primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"size:100;primary_key;index:idx_task_executions_exec;index"` // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` @@ -72,9 +72,9 @@ type TaskExecutionKey struct { type TaskExecution struct { models.BaseModel TaskExecutionKey - Phase string + Phase string `gorm:"size:100"` PhaseVersion uint32 - InputURI string + InputURI string `gorm:"size:100"` Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the TaskExecution closure From 39ee1185663e69d8b805b35953965be514e1b89b Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Fri, 24 Mar 2023 13:24:44 -0700 Subject: [PATCH 15/37] Revert "Remove old cruft" This reverts commit 8808346a41d41f7767034e2e4bd45a909e55ba5f. Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migrations.go | 435 ++++++++++++++++++++- pkg/repositories/config/migrations_test.go | 2 +- 2 files changed, 425 insertions(+), 12 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index d3ec4d09d..ed7cc05db 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -205,13 +205,26 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Exec("UPDATE named_entity_metadata set state = NULL").Error }, }, + // FIXME: the syntax ALTER TABLE T DROP COLUMN IF EXISTS c is invalid in mysql. + // TODO: remove mentions to that from other queries ((including rollbacks)) // Modify the workflows table, if necessary { ID: "2020-04-03-workflow-state", Migrate: func(tx *gorm.DB) error { - return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS state").Error + if !tx.Model(&models.Workflow{}).Migrator().HasColumn(&models.Workflow{}, "state") { + return nil + } + if err := tx.Model(&models.Workflow{}).Migrator().DropColumn(&models.Workflow{}, "state"); err != nil { + return err + } + return nil }, Rollback: func(tx *gorm.DB) error { + // TODO: the column state is not going to be present in the model. Does this mean that we cannot + // rely on gorm to restore the column? + // if err := tx.Model(&models.Workflow{}).Migrator().AddColumn(&models.Workflow{}, "state"); err != nil { + // return err + // } return tx.Exec("ALTER TABLE workflows ADD COLUMN IF NOT EXISTS state integer;").Error }, }, @@ -344,17 +357,17 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Migrator().DropTable(&schedulerModels.ScheduleEntitiesSnapshot{}, "schedulable_entities_snapshot") }, }, - // For any new table, Please use the following pattern due to a bug // in the postgres gorm layer https://github.com/go-gorm/postgres/issues/65 { ID: "2022-01-11-id-to-bigint", Migrate: func(tx *gorm.DB) error { - db, err := tx.DB() - if err != nil { - return err - } - return alterTableColumnType(db, "id", "bigint") + return nil + // db, err := tx.DB() + // if err != nil { + // return err + // } + // return alterTableColumnType(db, "id", "bigint") }, Rollback: func(tx *gorm.DB) error { db, err := tx.DB() @@ -405,7 +418,7 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Migrator().DropTable("description_entities") }, }, - // Modify the tasks table, if necessary + // // Modify the tasks table, if necessary { ID: "2020-09-13-task-short_description", Migrate: func(tx *gorm.DB) error { @@ -425,7 +438,7 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS short_description").Error }, }, - // Create signals table. + // // Create signals table. { ID: "2022-04-11-signals", Migrate: func(tx *gorm.DB) error { @@ -1464,10 +1477,410 @@ func alterTableColumnType(db *sql.DB, columnName, columnType string) error { var err error for _, table := range tables { - if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, - columnType)); err != nil { + // if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, + // columnType)); err != nil { + // return err + // } + // TODO: figure out how to get the driver name + if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE %s MODIFY COLUMN %s %s`, table, columnName, columnType)); err != nil { return err } } return nil } + +// func alterTableColumnTypeGorm(tx *gorm.DB, columnName, columnType string) error { +// for tableName, model := range gorm_models { +// if tx.Model(model).Migrator().HasColumn(model, "columnName") { +// tx.Migrator().MigrateColumn(model, field *schema.Field, columnType gorm.ColumnType) +// } +// } +// } + +var Migrations = []*gormigrate.Migration{ + /* The following is a series of Postgres specific migrations. They should mirror the state + of the database as of 2023 March. The rollback is a noop for everything because the migration itself should + be a noop. + */ + // need to add not null, re-running old migrations now seems to drop the not null constraint on ID. + + { + ID: "pg-noop-2023-03-31-noop-project-3", + Migrate: func(tx *gorm.DB) error { + type Project struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Identifier string `gorm:"primary_key"` + Name string `valid:"length(0|255)"` // Human-readable name, not a unique identifier. + Description string `gorm:"type:varchar(300)"` + Labels []byte + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0;index"` + } + return tx.AutoMigrate(&Project{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + // ALTER TABLE "projects" ALTER COLUMN "id" DROP NOT NULL otherwise. + + { + ID: "pg-noop-2023-03-31-noop-task-2", + Migrate: func(tx *gorm.DB) error { + type Task struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` + Closure []byte `gorm:"not null"` + // Hash of the compiled task closure + Digest []byte + // Task type (also stored in the closure put promoted as a column for filtering). + Type string `gorm:"" valid:"length(0|255)"` + // ShortDescription for the task. + ShortDescription string + } + return tx.AutoMigrate(&Task{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-workflow", + Migrate: func(tx *gorm.DB) error { + type Workflow struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key"` + TypedInterface []byte + RemoteClosureIdentifier string `gorm:"not null" valid:"length(0|255)"` + // Hash of the compiled workflow closure + Digest []byte + // ShortDescription for the workflow. + ShortDescription string + } + return tx.AutoMigrate(&Workflow{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-launchplan", + Migrate: func(tx *gorm.DB) error { + type LaunchPlanScheduleType string + + const ( + LaunchPlanScheduleTypeNONE LaunchPlanScheduleType = "NONE" + LaunchPlanScheduleTypeCRON LaunchPlanScheduleType = "CRON" + LaunchPlanScheduleTypeRATE LaunchPlanScheduleType = "RATE" + ) + + type LaunchPlan struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:lp_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0"` + // Hash of the launch plan + Digest []byte + ScheduleType LaunchPlanScheduleType + } + return tx.AutoMigrate(&LaunchPlan{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-namedentitymetadata", + Migrate: func(tx *gorm.DB) error { + type NamedEntityMetadata struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Description string `gorm:"type:varchar(300)"` + // GORM doesn't save the zero value for ints, so we use a pointer for the State field + State *int32 `gorm:"default:0"` + } + + return tx.AutoMigrate(&NamedEntityMetadata{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-taskexecution-3", + Migrate: func(tx *gorm.DB) error { + type TaskKey struct { + Project string `gorm:"primary_key"` + Domain string `gorm:"primary_key"` + Name string `gorm:"primary_key"` + Version string `gorm:"primary_key"` + } + type TaskExecutionKey struct { + TaskKey + Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` + // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. + // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. + RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` + } + type TaskExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + TaskExecutionKey + Phase string `gorm:"type:text"` + PhaseVersion uint32 + InputURI string `gorm:"type:text"` + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was createdAt, not to be confused with gorm.Model.CreatedAt + TaskExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt + TaskExecutionUpdatedAt *time.Time + Duration time.Duration + // The child node executions (if any) launched by this task execution. + ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` + } + + return tx.AutoMigrate(&TaskExecution{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + // ALTER TABLE "task_executions" ALTER COLUMN "phase" TYPE varchar(100) USING "phase"::varchar(100) + // ALTER TABLE "task_executions" ALTER COLUMN "input_uri" TYPE varchar(100) USING "input_uri"::varchar(100) + + { + ID: "pg-noop-2023-03-31-noop-nodeexecution-2", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"primary_key;column:execution_project"` + Domain string `gorm:"primary_key;column:execution_domain"` + Name string `gorm:"primary_key;column:execution_name"` + } + + type NodeExecutionKey struct { + ExecutionKey + NodeID string `gorm:"primary_key;index"` + } + type NodeExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + NodeExecutionKey + // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. + Phase string + InputURI string + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the NodeExecution closure + // Prefixed with NodeExecution to avoid clashes with gorm.Model CreatedAt + NodeExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the NodeExecution closure + // Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt + NodeExecutionUpdatedAt *time.Time + Duration time.Duration + // The task execution (if any) which launched this node execution. + ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` + // The workflow execution (if any) which this node execution launched + LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` + // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. + DynamicWorkflowRemoteClosureReference string + // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. + InternalData []byte + } + + return tx.AutoMigrate(&NodeExecution{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-execution-event", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` + } + type ExecutionEvent struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + ExecutionKey + RequestID string `valid:"length(0|255)"` + OccurredAt time.Time + Phase string `gorm:"primary_key"` + } + + return tx.AutoMigrate(&ExecutionEvent{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-node-execution-event", + Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` + } + type NodeExecutionKey struct { + ExecutionKey + NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` + } + type NodeExecutionEvent struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + NodeExecutionKey + RequestID string + OccurredAt time.Time + Phase string `gorm:"primary_key"` + } + + return tx.AutoMigrate(&NodeExecutionEvent{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-description-entity-2", + Migrate: func(tx *gorm.DB) error { + type DescriptionEntityKey struct { + ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + } + + // SourceCode Database model to encapsulate a SourceCode. + type SourceCode struct { + Link string `valid:"length(0|255)"` + } + + // DescriptionEntity Database model to encapsulate a DescriptionEntity. + type DescriptionEntity struct { + DescriptionEntityKey + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + SourceCode + ShortDescription string + LongDescription []byte + } + + return tx.AutoMigrate(&DescriptionEntity{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-signal", + Migrate: func(tx *gorm.DB) error { + type SignalKey struct { + ExecutionKey + SignalID string `gorm:"primary_key;index" valid:"length(0|255)"` + } + + type Signal struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + SignalKey + Type []byte `gorm:"not null"` + Value []byte + } + + return tx.AutoMigrate(&Signal{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, + + { + ID: "pg-noop-2023-03-31-noop-resource-3", + Migrate: func(tx *gorm.DB) error { + type ResourcePriority int32 + + // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique + type Resource struct { + ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time `sql:"index"` + Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Priority ResourcePriority + // Serialized flyteidl.admin.MatchingAttributes. + Attributes []byte + } + + return tx.AutoMigrate(&Resource{}) + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, +} diff --git a/pkg/repositories/config/migrations_test.go b/pkg/repositories/config/migrations_test.go index a5a135017..6d43420a7 100644 --- a/pkg/repositories/config/migrations_test.go +++ b/pkg/repositories/config/migrations_test.go @@ -71,7 +71,7 @@ func TestMigrations(t *testing.T) { fmt.Println(gormDb) - m := gormigrate.New(gormDb, gormigrate.DefaultOptions, ListMigrations(gormDb)) + m := gormigrate.New(gormDb, gormigrate.DefaultOptions, Migrations) if err := m.Migrate(); err != nil { fmt.Errorf("database migration failed: %v", err) } From c0c25a07f75a7cc7dba9a143d36c7bb24ad76582 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Fri, 24 Mar 2023 13:25:09 -0700 Subject: [PATCH 16/37] Revert "Reapply migration changes." This reverts commit 0c9d2b497cf15761dda9529c8e924cec9d280baa. Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migrations.go | 40 +++++++------------ pkg/repositories/models/description_entity.go | 4 +- pkg/repositories/models/execution.go | 24 +++++------ pkg/repositories/models/execution_event.go | 4 +- pkg/repositories/models/launch_plan.go | 11 +++-- pkg/repositories/models/named_entity.go | 6 +-- pkg/repositories/models/node_execution.go | 20 ++++------ .../models/node_execution_event.go | 4 +- pkg/repositories/models/project.go | 6 +-- pkg/repositories/models/resource.go | 10 ++--- pkg/repositories/models/signal.go | 2 +- pkg/repositories/models/task.go | 12 +++--- pkg/repositories/models/task_execution.go | 6 +-- pkg/repositories/models/workflow.go | 5 +-- .../repositories/models/schedulable_entity.go | 6 +-- 15 files changed, 67 insertions(+), 93 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index ed7cc05db..d718d6b71 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -745,7 +745,6 @@ var NoopMigrations = []*gormigrate.Migration{ // TO BE DEPRECATED - as we have now introduced ParentID ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` // The workflow execution (if any) which this node execution launched - // FIXME: this is refering to a migration model (i.e. not inlined). LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. DynamicWorkflowRemoteClosureReference string @@ -1074,7 +1073,7 @@ var FixupMigrations = []*gormigrate.Migration{ CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` - ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + ResourceType core.ResourceType `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Project string `gorm:"size:64;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Domain string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Name string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` @@ -1134,10 +1133,10 @@ var FixupMigrations = []*gormigrate.Migration{ // User specified inputs. This map might be incomplete and not include defaults applied UserInputsURI storage.DataReference // Execution Error Kind. nullable - // FIXME: This is a string representation of the enum ExecutionError.ErrorKind + // TODO: This is a string representation of the enum ExecutionError.ErrorKind ErrorKind *string `gorm:"size:10;index"` // Execution Error Code nullable - // FIXME: This is a string representation of the enum ExecutionError.code + // TODO: This is a string representation of the enum ExecutionError.code ErrorCode *string `gorm:"size:100"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. @@ -1226,9 +1225,7 @@ var FixupMigrations = []*gormigrate.Migration{ DeletedAt *time.Time `gorm:"index"` NodeExecutionKey // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. - // FIXME: how short should this be? Phase string `gorm:"size:255"` - // FIXME: how short should this be? InputURI string `gorm:"size:255"` Closure []byte StartedAt *time.Time @@ -1239,33 +1236,26 @@ var FixupMigrations = []*gormigrate.Migration{ // Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt NodeExecutionUpdatedAt *time.Time Duration time.Duration - // Metadata about the node execution. + // The task execution (if any) which launched this node execution. + // TO BE DEPRECATED - as we have now introduced ParentID + ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` + // The workflow execution (if any) which this node execution launched + LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` + // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. + DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` + // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. + InternalData []byte NodeExecutionMetadata []byte // Parent that spawned this node execution - value is empty for executions at level 0 ParentID *uint `sql:"default:null" gorm:"index"` // List of child node executions - for cases like Dynamic task, sub workflow, etc ChildNodeExecutions []NodeExecution `gorm:"foreignKey:ParentID;references:ID"` - // The task execution (if any) which launched this node execution. - // TO BE DEPRECATED - as we have now introduced ParentID - ParentTaskExecutionID *uint `sql:"default:null" gorm:"index"` - // The workflow execution (if any) which this node execution launched - // NOTE: LaunchedExecution[foreignkey:ParentNodeExecutionID] refers to Workflow execution launched and is different from ParentID - // FIXME: this is refering to a migration model (i.e. not inlined). - LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` // Execution Error Kind. nullable, can be one of core.ExecutionError_ErrorKind - // FIXME: how short should this be? ErrorKind *string `gorm:"size:255;index"` // Execution Error Code nullable. string value, but finite set determined by the execution engine and plugins - // FIXME: how short should this be? ErrorCode *string `gorm:"size:255"` // If the node is of Type Task, this should always exist for a successful execution, indicating the cache status for the execution - // FIXME: how short should this be? CacheStatus *string `gorm:"size:255"` - // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. - // FIXME: can this be this small? - DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` - // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. - InternalData []byte } return tx.AutoMigrate(&NodeExecution{}) @@ -1289,7 +1279,7 @@ var FixupMigrations = []*gormigrate.Migration{ DeletedAt *time.Time `gorm:"index"` ExecutionKey RequestID string `gorm:"size:255"` - OccurredAt time.Time + OccurredAt time.Time `gorm:"type:time"` Phase string `gorm:"size:255;primary_key"` } @@ -1429,11 +1419,11 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time DeletedAt *time.Time `gorm:"index"` SchedulableEntityKey - // FIXME: figure out if this is just the schedule definition. + // TODO: figure out if this is just the schedule definition. CronExpression string `gorm:"size:100"` FixedRateValue uint32 Unit admin.FixedRateUnit - // FIXME: figure out how big this should be. + // TODO: figure out how big this should be. KickoffTimeInputArg string `gorm:"size:100"` Active *bool } diff --git a/pkg/repositories/models/description_entity.go b/pkg/repositories/models/description_entity.go index dc19aab6d..c7290bca9 100644 --- a/pkg/repositories/models/description_entity.go +++ b/pkg/repositories/models/description_entity.go @@ -13,7 +13,7 @@ type DescriptionEntityKey struct { // SourceCode Database model to encapsulate a SourceCode. type SourceCode struct { - Link string `gorm:"size:255"` + Link string `gorm:"size:100" valid:"length(0|255)"` } // DescriptionEntity Database model to encapsulate a DescriptionEntity. @@ -24,7 +24,7 @@ type DescriptionEntity struct { SourceCode - ShortDescription string `gorm:"size:255"` + ShortDescription string `gorm:"size:100` LongDescription []byte } diff --git a/pkg/repositories/models/execution.go b/pkg/repositories/models/execution.go index 4d1f4f4fb..6b30e0eb1 100644 --- a/pkg/repositories/models/execution.go +++ b/pkg/repositories/models/execution.go @@ -11,9 +11,9 @@ import ( // Execution primary key type ExecutionKey struct { - Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:255;primary_key;column:execution_domain"` - Name string `gorm:"size:255;primary_key;column:execution_name"` + Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` } // Database model to encapsulate a (workflow) execution. @@ -23,7 +23,7 @@ type Execution struct { LaunchPlanID uint `gorm:"index"` WorkflowID uint `gorm:"index"` TaskID uint `gorm:"index"` - Phase string `gorm:"size:255"` + Phase string `valid:"length(0|255)"` Closure []byte Spec []byte `gorm:"not null"` StartedAt *time.Time @@ -36,7 +36,7 @@ type Execution struct { Duration time.Duration // In the case of an aborted execution this string may be non-empty. // It should be ignored for any other value of phase other than aborted. - AbortCause string `gorm:"size:255"` + AbortCause string `valid:"length(0|255)"` // Corresponds to the execution mode used to trigger this execution Mode int32 // The "parent" execution (if there is one) that is related to this execution. @@ -44,24 +44,20 @@ type Execution struct { // The parent node execution if this was launched by a node ParentNodeExecutionID uint // Cluster where execution was triggered - Cluster string `gorm:"size:255"` + Cluster string `valid:"length(0|255)"` // Offloaded location of inputs LiteralMap. These are the inputs evaluated and contain applied defaults. InputsURI storage.DataReference // User specified inputs. This map might be incomplete and not include defaults applied UserInputsURI storage.DataReference // Execution Error Kind. nullable - // TODO: This is a string representation of the enum ExecutionError.ErrorKind - ErrorKind *string `gorm:"size:10;index"` + ErrorKind *string `gorm:"index"` // Execution Error Code nullable - // TODO: This is a string representation of the enum ExecutionError.code - ErrorCode *string `gorm:"size:100"` + ErrorCode *string `valid:"length(0|255)"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. - User string `gorm:"size:100;index"` + User string `gorm:"index" valid:"length(0|255)"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field State *int32 `gorm:"index;default:0"` // The resource type of the entity used to launch the execution, one of 'launch_plan' or 'task' - // FIXME: By default a field without a gorm tag gets the default value for that type, which for strings - // is varchar(255). - LaunchEntity string `gorm:"size:100"` + LaunchEntity string } diff --git a/pkg/repositories/models/execution_event.go b/pkg/repositories/models/execution_event.go index 6e4685446..b6e18decc 100644 --- a/pkg/repositories/models/execution_event.go +++ b/pkg/repositories/models/execution_event.go @@ -7,7 +7,7 @@ import ( type ExecutionEvent struct { BaseModel ExecutionKey - RequestID string `gorm:"size:255"` + RequestID string `valid:"length(0|255)"` OccurredAt time.Time - Phase string `gorm:"size:255;primary_key"` + Phase string `gorm:"primary_key"` } diff --git a/pkg/repositories/models/launch_plan.go b/pkg/repositories/models/launch_plan.go index 6afa5534a..2b2787518 100644 --- a/pkg/repositories/models/launch_plan.go +++ b/pkg/repositories/models/launch_plan.go @@ -1,7 +1,6 @@ package models // Launch plan primary key -// TODO: Add size constraints to the fields type LaunchPlanKey struct { Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` @@ -24,12 +23,12 @@ const ( type LaunchPlan struct { BaseModel LaunchPlanKey - Spec []byte `gorm:"not null"` - WorkflowID uint `gorm:"index"` - Closure []byte `gorm:"not null"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` + State *int32 `gorm:"default:0"` // Hash of the launch plan Digest []byte - ScheduleType LaunchPlanScheduleType `gorm:"size:255"` + ScheduleType LaunchPlanScheduleType } diff --git a/pkg/repositories/models/named_entity.go b/pkg/repositories/models/named_entity.go index ff3b33368..966676d0c 100644 --- a/pkg/repositories/models/named_entity.go +++ b/pkg/repositories/models/named_entity.go @@ -7,9 +7,9 @@ import ( // NamedEntityMetadata primary key type NamedEntityMetadataKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Project string `gorm:"size:64;primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Domain string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Name string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` } // Fields to be composed into any named entity diff --git a/pkg/repositories/models/node_execution.go b/pkg/repositories/models/node_execution.go index b88312cab..f45c8caec 100644 --- a/pkg/repositories/models/node_execution.go +++ b/pkg/repositories/models/node_execution.go @@ -9,7 +9,7 @@ import ( type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:255;primary_key;index"` + NodeID string `gorm:"size:180;primary_key;index" valid:"length(0|180)"` } // By convention, gorm foreign key references are of the form {ModelName}ID @@ -17,10 +17,8 @@ type NodeExecution struct { BaseModel NodeExecutionKey // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. - // FIXME: how short should this be? - Phase string `gorm:"size:255"` - // FIXME: how short should this be? - InputURI string `gorm:"size:255"` + Phase string + InputURI string Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the NodeExecution closure @@ -43,17 +41,13 @@ type NodeExecution struct { // NOTE: LaunchedExecution[foreignkey:ParentNodeExecutionID] refers to Workflow execution launched and is different from ParentID LaunchedExecution Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` // Execution Error Kind. nullable, can be one of core.ExecutionError_ErrorKind - // FIXME: how short should this be? - ErrorKind *string `gorm:"size:255;index"` + ErrorKind *string `gorm:"index"` // Execution Error Code nullable. string value, but finite set determined by the execution engine and plugins - // FIXME: how short should this be? - ErrorCode *string `gorm:"size:255"` + ErrorCode *string // If the node is of Type Task, this should always exist for a successful execution, indicating the cache status for the execution - // FIXME: how short should this be? - CacheStatus *string `gorm:"size:255"` + CacheStatus *string // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. - // FIXME: can this be this small? - DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` + DynamicWorkflowRemoteClosureReference string // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. InternalData []byte } diff --git a/pkg/repositories/models/node_execution_event.go b/pkg/repositories/models/node_execution_event.go index 1a4600a74..550540231 100644 --- a/pkg/repositories/models/node_execution_event.go +++ b/pkg/repositories/models/node_execution_event.go @@ -7,7 +7,7 @@ import ( type NodeExecutionEvent struct { BaseModel NodeExecutionKey - RequestID string `gorm:"size:255"` + RequestID string OccurredAt time.Time - Phase string `gorm:"size:255;primary_key"` + Phase string `gorm:"size:128;primary_key"` } diff --git a/pkg/repositories/models/project.go b/pkg/repositories/models/project.go index 9cbdbb42c..a5feedb27 100644 --- a/pkg/repositories/models/project.go +++ b/pkg/repositories/models/project.go @@ -2,9 +2,9 @@ package models type Project struct { BaseModel - Identifier string `gorm:"primary_key"` - Name string `gorm:"size:64"` // Human-readable name, not a unique identifier. - Description string `gorm:"type:varchar(300)"` + Identifier string `gorm:"primary_key"` + Name string `valid:"length(0|255)"` // Human-readable name, not a unique identifier. + Description string `gorm:"type:varchar(300)"` Labels []byte // GORM doesn't save the zero value for ints, so we use a pointer for the State field State *int32 `gorm:"default:0;index"` diff --git a/pkg/repositories/models/resource.go b/pkg/repositories/models/resource.go index a13ca5fab..ae91919dd 100644 --- a/pkg/repositories/models/resource.go +++ b/pkg/repositories/models/resource.go @@ -18,11 +18,11 @@ type Resource struct { CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"size:64;uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"size:255;uniqueIndex:resource_idx" valid:"length(0|255)"` + Project string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte diff --git a/pkg/repositories/models/signal.go b/pkg/repositories/models/signal.go index af21bd487..8a7fac693 100644 --- a/pkg/repositories/models/signal.go +++ b/pkg/repositories/models/signal.go @@ -3,7 +3,7 @@ package models // Signal primary key type SignalKey struct { ExecutionKey - SignalID string `gorm:"size:255;primary_key;index"` + SignalID string `gorm:"primary_key;index" valid:"length(0|255)"` } // Database model to encapsulate a signal. diff --git a/pkg/repositories/models/task.go b/pkg/repositories/models/task.go index cb2c8f4a5..3a8ca9fa9 100644 --- a/pkg/repositories/models/task.go +++ b/pkg/repositories/models/task.go @@ -6,20 +6,20 @@ package models // Task primary key type TaskKey struct { Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"size:255;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"size:255;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"size:255;primary_key" valid:"length(0|255)"` + Domain string `gorm:"size:100;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"size:100;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"size:100;primary_key" valid:"length(0|255)"` } // Database model to encapsulate a task. type Task struct { BaseModel TaskKey - Closure []byte `gorm:"not null"` + Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"size:255"` + Type string `gorm:"size:100" valid:"length(0|255)"` // ShortDescription for the task. - ShortDescription string `gorm:"size:255"` + ShortDescription string `gorm:"size:100"` } diff --git a/pkg/repositories/models/task_execution.go b/pkg/repositories/models/task_execution.go index 5c2edd8b1..1f5717481 100644 --- a/pkg/repositories/models/task_execution.go +++ b/pkg/repositories/models/task_execution.go @@ -15,7 +15,6 @@ type TaskExecutionKey struct { NodeExecutionKey // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. - // TODO: why isn't AUTO_INCREMENT:FALSE not here? RetryAttempt *uint32 `gorm:"primary_key"` } @@ -23,9 +22,9 @@ type TaskExecutionKey struct { type TaskExecution struct { BaseModel TaskExecutionKey - Phase string `gorm:"size:255"` + Phase string `valid:"length(0|255)"` PhaseVersion uint32 - InputURI string `gorm:"size:255"` + InputURI string `valid:"length(0|255)"` Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the TaskExecution closure @@ -38,6 +37,5 @@ type TaskExecution struct { TaskExecutionUpdatedAt *time.Time Duration time.Duration // The child node executions (if any) launched by this task execution. - // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` } diff --git a/pkg/repositories/models/workflow.go b/pkg/repositories/models/workflow.go index a595a884c..f431c47b3 100644 --- a/pkg/repositories/models/workflow.go +++ b/pkg/repositories/models/workflow.go @@ -1,7 +1,6 @@ package models // Workflow primary key -// TODO: Add size to the fields type WorkflowKey struct { Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` @@ -14,9 +13,9 @@ type Workflow struct { BaseModel WorkflowKey TypedInterface []byte - RemoteClosureIdentifier string `gorm:"size:255;not null"` + RemoteClosureIdentifier string `gorm:"not null" valid:"length(0|255)"` // Hash of the compiled workflow closure Digest []byte // ShortDescription for the workflow. - ShortDescription string `gorm:"size:255"` + ShortDescription string } diff --git a/scheduler/repositories/models/schedulable_entity.go b/scheduler/repositories/models/schedulable_entity.go index e1d10f3c3..550a2292a 100644 --- a/scheduler/repositories/models/schedulable_entity.go +++ b/scheduler/repositories/models/schedulable_entity.go @@ -9,12 +9,10 @@ import ( type SchedulableEntity struct { models.BaseModel SchedulableEntityKey - // FIXME: figure out if this is just the schedule definition. - CronExpression string `gorm:"size:100"` + CronExpression string FixedRateValue uint32 Unit admin.FixedRateUnit - // FIXME: figure out how big this should be. - KickoffTimeInputArg string `gorm:"size:100"` + KickoffTimeInputArg string Active *bool } From 72b2a856ba1c13d4364a16e3478a319515e61610 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 16:57:19 -0700 Subject: [PATCH 17/37] Remove size statements from models Signed-off-by: eduardo apolinario --- pkg/repositories/models/description_entity.go | 12 ++++++------ pkg/repositories/models/execution.go | 6 +++--- pkg/repositories/models/node_execution.go | 2 +- pkg/repositories/models/node_execution_event.go | 2 +- pkg/repositories/models/resource.go | 10 +++++----- pkg/repositories/models/task.go | 12 ++++++------ 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pkg/repositories/models/description_entity.go b/pkg/repositories/models/description_entity.go index c7290bca9..d1f30373f 100644 --- a/pkg/repositories/models/description_entity.go +++ b/pkg/repositories/models/description_entity.go @@ -5,15 +5,15 @@ import "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" // DescriptionEntityKey DescriptionEntity primary key type DescriptionEntityKey struct { ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"size:100;primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` } // SourceCode Database model to encapsulate a SourceCode. type SourceCode struct { - Link string `gorm:"size:100" valid:"length(0|255)"` + Link string `valid:"length(0|255)"` } // DescriptionEntity Database model to encapsulate a DescriptionEntity. @@ -24,7 +24,7 @@ type DescriptionEntity struct { SourceCode - ShortDescription string `gorm:"size:100` + ShortDescription string LongDescription []byte } diff --git a/pkg/repositories/models/execution.go b/pkg/repositories/models/execution.go index 6b30e0eb1..f55b4b914 100644 --- a/pkg/repositories/models/execution.go +++ b/pkg/repositories/models/execution.go @@ -11,9 +11,9 @@ import ( // Execution primary key type ExecutionKey struct { - Project string `gorm:"size:127;primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"size:127;primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"size:127;primary_key;column:execution_name" valid:"length(0|127)"` + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` } // Database model to encapsulate a (workflow) execution. diff --git a/pkg/repositories/models/node_execution.go b/pkg/repositories/models/node_execution.go index f45c8caec..a26d85d1e 100644 --- a/pkg/repositories/models/node_execution.go +++ b/pkg/repositories/models/node_execution.go @@ -9,7 +9,7 @@ import ( type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:180;primary_key;index" valid:"length(0|180)"` + NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` } // By convention, gorm foreign key references are of the form {ModelName}ID diff --git a/pkg/repositories/models/node_execution_event.go b/pkg/repositories/models/node_execution_event.go index 550540231..cd362c8ff 100644 --- a/pkg/repositories/models/node_execution_event.go +++ b/pkg/repositories/models/node_execution_event.go @@ -9,5 +9,5 @@ type NodeExecutionEvent struct { NodeExecutionKey RequestID string OccurredAt time.Time - Phase string `gorm:"size:128;primary_key"` + Phase string `gorm:"primary_key"` } diff --git a/pkg/repositories/models/resource.go b/pkg/repositories/models/resource.go index ae91919dd..01c570296 100644 --- a/pkg/repositories/models/resource.go +++ b/pkg/repositories/models/resource.go @@ -18,11 +18,11 @@ type Resource struct { CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"size:100;uniqueIndex:resource_idx" valid:"length(0|255)"` + Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` + ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte diff --git a/pkg/repositories/models/task.go b/pkg/repositories/models/task.go index 3a8ca9fa9..53ee1c8b8 100644 --- a/pkg/repositories/models/task.go +++ b/pkg/repositories/models/task.go @@ -5,10 +5,10 @@ package models // Task primary key type TaskKey struct { - Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"size:100;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"size:100;primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"size:100;primary_key" valid:"length(0|255)"` + Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` + Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` + Version string `gorm:"primary_key" valid:"length(0|255)"` } // Database model to encapsulate a task. @@ -19,7 +19,7 @@ type Task struct { // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"size:100" valid:"length(0|255)"` + Type string `valid:"length(0|255)"` // ShortDescription for the task. - ShortDescription string `gorm:"size:100"` + ShortDescription string } From 59d7b361220d6cd24c795bbc5ad204836b40f468 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:20:49 -0700 Subject: [PATCH 18/37] Bring back commented code and minor size changes Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migrations.go | 141 +++++++++++--------------- 1 file changed, 60 insertions(+), 81 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index d718d6b71..1540183a0 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -205,26 +205,13 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Exec("UPDATE named_entity_metadata set state = NULL").Error }, }, - // FIXME: the syntax ALTER TABLE T DROP COLUMN IF EXISTS c is invalid in mysql. - // TODO: remove mentions to that from other queries ((including rollbacks)) // Modify the workflows table, if necessary { ID: "2020-04-03-workflow-state", Migrate: func(tx *gorm.DB) error { - if !tx.Model(&models.Workflow{}).Migrator().HasColumn(&models.Workflow{}, "state") { - return nil - } - if err := tx.Model(&models.Workflow{}).Migrator().DropColumn(&models.Workflow{}, "state"); err != nil { - return err - } - return nil + return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS state").Error }, Rollback: func(tx *gorm.DB) error { - // TODO: the column state is not going to be present in the model. Does this mean that we cannot - // rely on gorm to restore the column? - // if err := tx.Model(&models.Workflow{}).Migrator().AddColumn(&models.Workflow{}, "state"); err != nil { - // return err - // } return tx.Exec("ALTER TABLE workflows ADD COLUMN IF NOT EXISTS state integer;").Error }, }, @@ -337,7 +324,6 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Model(&models.NodeExecution{}).Migrator().DropColumn(&models.NodeExecution{}, "dynamic_workflow_remote_closure_reference") }, }, - { ID: "2021-07-22-schedulable_entities", Migrate: func(tx *gorm.DB) error { @@ -347,7 +333,6 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Migrator().DropTable(&schedulerModels.SchedulableEntity{}, "schedulable_entities") }, }, - { ID: "2021-08-05-schedulable_entities_snapshot", Migrate: func(tx *gorm.DB) error { @@ -362,12 +347,11 @@ var LegacyMigrations = []*gormigrate.Migration{ { ID: "2022-01-11-id-to-bigint", Migrate: func(tx *gorm.DB) error { - return nil - // db, err := tx.DB() - // if err != nil { - // return err - // } - // return alterTableColumnType(db, "id", "bigint") + db, err := tx.DB() + if err != nil { + return err + } + return alterTableColumnType(db, "id", "bigint") }, Rollback: func(tx *gorm.DB) error { db, err := tx.DB() @@ -418,7 +402,7 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Migrator().DropTable("description_entities") }, }, - // // Modify the tasks table, if necessary + // Modify the tasks table, if necessary { ID: "2020-09-13-task-short_description", Migrate: func(tx *gorm.DB) error { @@ -438,7 +422,7 @@ var LegacyMigrations = []*gormigrate.Migration{ return tx.Exec("ALTER TABLE workflows DROP COLUMN IF EXISTS short_description").Error }, }, - // // Create signals table. + // Create signals table. { ID: "2022-04-11-signals", Migrate: func(tx *gorm.DB) error { @@ -972,7 +956,7 @@ var FixupMigrations = []*gormigrate.Migration{ CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` - Identifier string `gorm:"primary_key"` + Identifier string `gorm:"size:64;primary_key"` Name string `gorm:"size:64"` // Human-readable name, not a unique identifier. Description string `gorm:"type:varchar(300)"` Labels []byte @@ -994,9 +978,9 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" gorm:""` - Domain string `gorm:"size:255;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx"` - Name string `gorm:"size:255;primary_key;index:task_project_domain_name_idx"` - Version string `gorm:"size:255;primary_key"` + Domain string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx"` + Name string `gorm:"size:511;primary_key;index:task_project_domain_name_idx"` + Version string `gorm:"size:128;primary_key"` Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte @@ -1005,6 +989,7 @@ var FixupMigrations = []*gormigrate.Migration{ // ShortDescription for the task. ShortDescription string `gorm:"size:255"` } + return tx.AutoMigrate(&Task{}) }, Rollback: func(tx *gorm.DB) error { @@ -1020,15 +1005,15 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` - Domain string `gorm:"size:255;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` - Name string `gorm:"size:255;primary_key;index:workflow_project_domain_name_idx"` - Version string `gorm:"size:255;primary_key"` + Domain string `gorm:"size:64;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` + Name string `gorm:"size:511;primary_key;index:workflow_project_domain_name_idx"` + Version string `gorm:"size:128;primary_key"` TypedInterface []byte - RemoteClosureIdentifier string `gorm:"size:255;not null"` + RemoteClosureIdentifier string `gorm:"size:2048;not null"` // Hash of the compiled workflow closure Digest []byte // ShortDescription for the workflow. - ShortDescription string `gorm:"size:255"` + ShortDescription string `gorm:"size:2048"` } return tx.AutoMigrate(&Workflow{}) }, @@ -1047,9 +1032,9 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` Project string `gorm:"size:64;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` - Domain string `gorm:"size:255;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` - Name string `gorm:"size:255;primary_key;index:lp_project_domain_name_idx"` - Version string `gorm:"size:255;primary_key"` + Domain string `gorm:"size:64;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` + Name string `gorm:"size:511;primary_key;index:lp_project_domain_name_idx"` + Version string `gorm:"size:128;primary_key"` Spec []byte `gorm:"not null"` WorkflowID uint `gorm:"index"` Closure []byte `gorm:"not null"` @@ -1073,10 +1058,10 @@ var FixupMigrations = []*gormigrate.Migration{ CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` - ResourceType core.ResourceType `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Project string `gorm:"size:64;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` - Domain string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` - Name string `gorm:"size:255;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + Domain string `gorm:"size:64;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` + Name string `gorm:"size:511;primary_key;index:named_entity_metadata_type_project_domain_name_idx"` Description string `gorm:"type:varchar(300)"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field State *int32 `gorm:"default:0"` @@ -1093,8 +1078,8 @@ var FixupMigrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:255;primary_key;column:execution_domain"` - Name string `gorm:"size:255;primary_key;column:execution_name"` + Domain string `gorm:"size:64;primary_key;column:execution_domain"` + Name string `gorm:"size:511;primary_key;column:execution_name"` } type Execution struct { @@ -1106,7 +1091,7 @@ var FixupMigrations = []*gormigrate.Migration{ LaunchPlanID uint `gorm:"index"` WorkflowID uint `gorm:"index"` TaskID uint `gorm:"index"` - Phase string `gorm:"size:255"` + Phase string `gorm:"size:50"` Closure []byte Spec []byte `gorm:"not null"` StartedAt *time.Time @@ -1119,7 +1104,7 @@ var FixupMigrations = []*gormigrate.Migration{ Duration time.Duration // In the case of an aborted execution this string may be non-empty. // It should be ignored for any other value of phase other than aborted. - AbortCause string `gorm:"size:255"` + AbortCause string `gorm:"size:2048"` // Corresponds to the execution mode used to trigger this execution Mode int32 // The "parent" execution (if there is one) that is related to this execution. @@ -1127,26 +1112,22 @@ var FixupMigrations = []*gormigrate.Migration{ // The parent node execution if this was launched by a node ParentNodeExecutionID uint // Cluster where execution was triggered - Cluster string `gorm:"size:255"` + Cluster string `gorm:"size:512"` // Offloaded location of inputs LiteralMap. These are the inputs evaluated and contain applied defaults. InputsURI storage.DataReference // User specified inputs. This map might be incomplete and not include defaults applied UserInputsURI storage.DataReference // Execution Error Kind. nullable - // TODO: This is a string representation of the enum ExecutionError.ErrorKind - ErrorKind *string `gorm:"size:10;index"` + ErrorKind *string `gorm:"size:100;index"` // Execution Error Code nullable - // TODO: This is a string representation of the enum ExecutionError.code - ErrorCode *string `gorm:"size:100"` + ErrorCode *string `gorm:"size:2048"` // The user responsible for launching this execution. // This is also stored in the spec but promoted as a column for filtering. - User string `gorm:"size:100;index"` + User string `gorm:"size:128;index"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field State *int32 `gorm:"index;default:0"` // The resource type of the entity used to launch the execution, one of 'launch_plan' or 'task' - // FIXME: By default a field without a gorm tag gets the default value for that type, which for strings - // is varchar(255). - LaunchEntity string `gorm:"size:100"` + LaunchEntity string `gorm:"size:128"` } return tx.AutoMigrate(&Execution{}) @@ -1210,13 +1191,13 @@ var FixupMigrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:255;primary_key;column:execution_domain"` - Name string `gorm:"size:255;primary_key;column:execution_name"` + Domain string `gorm:"size:64;primary_key;column:execution_domain"` + Name string `gorm:"size:511;primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:255;primary_key;index"` + NodeID string `gorm:"size:30;primary_key;index"` } type NodeExecution struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -1225,8 +1206,8 @@ var FixupMigrations = []*gormigrate.Migration{ DeletedAt *time.Time `gorm:"index"` NodeExecutionKey // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. - Phase string `gorm:"size:255"` - InputURI string `gorm:"size:255"` + Phase string `gorm:"size:50"` + InputURI string `gorm:"size:2048"` Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the NodeExecution closure @@ -1242,7 +1223,7 @@ var FixupMigrations = []*gormigrate.Migration{ // The workflow execution (if any) which this node execution launched LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. - DynamicWorkflowRemoteClosureReference string `gorm:"size:255"` + DynamicWorkflowRemoteClosureReference string `gorm:"size:2048"` // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. InternalData []byte NodeExecutionMetadata []byte @@ -1251,7 +1232,7 @@ var FixupMigrations = []*gormigrate.Migration{ // List of child node executions - for cases like Dynamic task, sub workflow, etc ChildNodeExecutions []NodeExecution `gorm:"foreignKey:ParentID;references:ID"` // Execution Error Kind. nullable, can be one of core.ExecutionError_ErrorKind - ErrorKind *string `gorm:"size:255;index"` + ErrorKind *string `gorm:"size:50;index"` // Execution Error Code nullable. string value, but finite set determined by the execution engine and plugins ErrorCode *string `gorm:"size:255"` // If the node is of Type Task, this should always exist for a successful execution, indicating the cache status for the execution @@ -1269,8 +1250,8 @@ var FixupMigrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:255;primary_key;column:execution_domain"` - Name string `gorm:"size:255;primary_key;column:execution_name"` + Domain string `gorm:"size:64;primary_key;column:execution_domain"` + Name string `gorm:"size:511;primary_key;column:execution_name"` } type ExecutionEvent struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -1280,7 +1261,7 @@ var FixupMigrations = []*gormigrate.Migration{ ExecutionKey RequestID string `gorm:"size:255"` OccurredAt time.Time `gorm:"type:time"` - Phase string `gorm:"size:255;primary_key"` + Phase string `gorm:"size:50;primary_key"` } return tx.AutoMigrate(&ExecutionEvent{}) @@ -1294,12 +1275,12 @@ var FixupMigrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type ExecutionKey struct { Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:255;primary_key;column:execution_domain"` - Name string `gorm:"size:255;primary_key;column:execution_name"` + Domain string `gorm:"size:64;primary_key;column:execution_domain"` + Name string `gorm:"size:511;primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:180;primary_key;index"` + NodeID string `gorm:"size:30;primary_key;index"` } type NodeExecutionEvent struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -1309,7 +1290,7 @@ var FixupMigrations = []*gormigrate.Migration{ NodeExecutionKey RequestID string `gorm:"size:255"` OccurredAt time.Time - Phase string `gorm:"size:255;primary_key"` + Phase string `gorm:"size:50;primary_key"` } return tx.AutoMigrate(&NodeExecutionEvent{}) @@ -1325,14 +1306,14 @@ var FixupMigrations = []*gormigrate.Migration{ // ResourceType is an enum that indicates the type of the resource. We represent it as an uint32. ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx"` Project string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx"` - Domain string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx"` - Name string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx"` - Version string `gorm:"size:255;primary_key;index:description_entity_project_domain_name_version_idx"` + Domain string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx"` + Name string `gorm:"size:511;primary_key;index:description_entity_project_domain_name_version_idx"` + Version string `gorm:"size:128;primary_key;index:description_entity_project_domain_name_version_idx"` } // SourceCode Database model to encapsulate a SourceCode. type SourceCode struct { - Link string `gorm:"size:255"` + Link string `gorm:"size:2048"` } // DescriptionEntity Database model to encapsulate a DescriptionEntity. @@ -1343,7 +1324,7 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` SourceCode - ShortDescription string `gorm:"size:255"` + ShortDescription string `gorm:"size:2048"` LongDescription []byte } @@ -1388,11 +1369,11 @@ var FixupMigrations = []*gormigrate.Migration{ CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` - Project string `gorm:"size:64;uniqueIndex:resource_idx"` - Domain string `gorm:"size:255;uniqueIndex:resource_idx""` - Workflow string `gorm:"size:255;uniqueIndex:resource_idx""` - LaunchPlan string `gorm:"size:255;uniqueIndex:resource_idx""` - ResourceType string `gorm:"size:255;uniqueIndex:resource_idx""` + Project string `gorm:"size:64;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` + Domain string `gorm:"size:64;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` + Workflow string `gorm:"size:512;index:idx_project_domain_workflow_resource_type"` + LaunchPlan string `gorm:"size:512;index:idx_project_domain_launchplan_resource_type"` + ResourceType string `gorm:"size:50;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. Attributes []byte @@ -1409,9 +1390,9 @@ var FixupMigrations = []*gormigrate.Migration{ Migrate: func(tx *gorm.DB) error { type SchedulableEntityKey struct { Project string `gorm:"size:64;primary_key"` - Domain string `gorm:"size:255;primary_key"` - Name string `gorm:"size:255;primary_key"` - Version string `gorm:"size:255;primary_key"` + Domain string `gorm:"size:64;primary_key"` + Name string `gorm:"size:511;primary_key"` + Version string `gorm:"size:128;primary_key"` } type SchedulableEntity struct { ID uint `gorm:"index;autoIncrement;not null"` @@ -1419,11 +1400,9 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time DeletedAt *time.Time `gorm:"index"` SchedulableEntityKey - // TODO: figure out if this is just the schedule definition. CronExpression string `gorm:"size:100"` FixedRateValue uint32 Unit admin.FixedRateUnit - // TODO: figure out how big this should be. KickoffTimeInputArg string `gorm:"size:100"` Active *bool } From 8901ea25657e4303648d51045703185528280687 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:25:23 -0700 Subject: [PATCH 19/37] Special-case mysql in the case of the `task_executions` table. Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 133 ++++++++++++++++++-------- 1 file changed, 92 insertions(+), 41 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 1540183a0..5bc8e70e1 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1139,48 +1139,99 @@ var FixupMigrations = []*gormigrate.Migration{ { ID: "2023-03-31-fixup-taskexecution", Migrate: func(tx *gorm.DB) error { - type TaskKey struct { - Project string `gorm:"size:64;primary_key"` - Domain string `gorm:"size:255;primary_key"` - Name string `gorm:"size:255;primary_key"` - Version string `gorm:"size:255;primary_key"` - } - type TaskExecutionKey struct { - TaskKey - Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"size:255;primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"size:255;primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"size:255;primary_key;index:idx_task_executions_exec;index"` - // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. - // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. - RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` + // The `task_executions` table is a special case because of the number of fields present in its primary key. + // Postgres does not have a restriction on the total length of its primary keys, however, the same is not true + // for MySQL. MySQL has a limit of 3072 bytes for the total length of the primary key. So, in that case we rely + // on secondary indexes instead. + if tx.Dialector.Name() == "mysql" { + type TaskKey struct { + Project string `gorm:"size:64;index:idx_taskkey_project_domain_name_version"` + Domain string `gorm:"size:64;index:idx_taskkey_project_domain_name_version"` + Name string `gorm:"size:511;index:idx_taskkey_project_domain_name_version"` + Version string `gorm:"size:128;index:idx_taskkey_project_domain_name_version"` + } + type TaskExecutionKey struct { + TaskKey + Project string `gorm:"size:64;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;column:execution_project"` + Domain string `gorm:"size:64;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;column:execution_domain"` + Name string `gorm:"size:511;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;column:execution_name"` + NodeID string `gorm:"size:30;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;"` + // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. + // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. + RetryAttempt *uint32 `gorm:"index:idx_taskexecutionkey_project_domain_name_nodeid_retry;AUTO_INCREMENT:FALSE"` + } + type TaskExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time + TaskExecutionKey + Phase string `gorm:"size:255"` + PhaseVersion uint32 + InputURI string `gorm:"size:2048"` + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was createdAt, not to be confused with gorm.Model.CreatedAt + TaskExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt + TaskExecutionUpdatedAt *time.Time + Duration time.Duration + // The child node executions (if any) launched by this task execution. + // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? + ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` + } + + return tx.AutoMigrate(&TaskExecution{}) + } else { + // For all other databases, we can use the primary key as defined in the model. + // ** Please, keep the model definitions in sync with the mysql ones defined above. ** + type TaskKey struct { + Project string `gorm:"size:64;primary_key"` + Domain string `gorm:"size:64;primary_key"` + Name string `gorm:"size:511;primary_key"` + Version string `gorm:"size:128;primary_key"` + } + type TaskExecutionKey struct { + TaskKey + Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"size:64;primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"size:511;primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"size:30;primary_key;index:idx_task_executions_exec;index"` + // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. + // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. + RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` + } + type TaskExecution struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + TaskExecutionKey + Phase string `gorm:"size:50"` + PhaseVersion uint32 + InputURI string `gorm:"size:2048"` + Closure []byte + StartedAt *time.Time + // Corresponds to the CreatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was createdAt, not to be confused with gorm.Model.CreatedAt + TaskExecutionCreatedAt *time.Time + // Corresponds to the UpdatedAt field in the TaskExecution closure + // This field is prefixed with TaskExecution because it signifies when + // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt + TaskExecutionUpdatedAt *time.Time + Duration time.Duration + // The child node executions (if any) launched by this task execution. + // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? + ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` + } + + return tx.AutoMigrate(&TaskExecution{}) } - type TaskExecution struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - TaskExecutionKey - Phase string `gorm:"size:255"` - PhaseVersion uint32 - InputURI string `gorm:"size:255"` - Closure []byte - StartedAt *time.Time - // Corresponds to the CreatedAt field in the TaskExecution closure - // This field is prefixed with TaskExecution because it signifies when - // the execution was createdAt, not to be confused with gorm.Model.CreatedAt - TaskExecutionCreatedAt *time.Time - // Corresponds to the UpdatedAt field in the TaskExecution closure - // This field is prefixed with TaskExecution because it signifies when - // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt - TaskExecutionUpdatedAt *time.Time - Duration time.Duration - // The child node executions (if any) launched by this task execution. - // TODO: this refers to `NodeExecution` defined at the top of this file. Should this also be defined inline? - ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` - } - - return tx.AutoMigrate(&TaskExecution{}) }, Rollback: func(tx *gorm.DB) error { return nil From 9029ec14831d6e2f90b0d3b5e9dd864e4fa735cd Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:28:48 -0700 Subject: [PATCH 20/37] Remove size statements from `migration_models.go` file Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migration_models.go | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/repositories/config/migration_models.go b/pkg/repositories/config/migration_models.go index 37b1d2c18..712580b1d 100644 --- a/pkg/repositories/config/migration_models.go +++ b/pkg/repositories/config/migration_models.go @@ -16,21 +16,21 @@ import ( */ type TaskKey struct { - Project string `gorm:"size:64;primary_key"` - Domain string `gorm:"size:100;primary_key"` - Name string `gorm:"size:100;primary_key"` - Version string `gorm:"size:100;primary_key"` + Project string `gorm:"primary_key"` + Domain string `gorm:"primary_key"` + Name string `gorm:"primary_key"` + Version string `gorm:"primary_key"` } type ExecutionKey struct { - Project string `gorm:"size:64;primary_key;column:execution_project"` - Domain string `gorm:"size:100;primary_key;column:execution_domain"` - Name string `gorm:"size:100;primary_key;column:execution_name"` + Project string `gorm:"primary_key;column:execution_project"` + Domain string `gorm:"primary_key;column:execution_domain"` + Name string `gorm:"primary_key;column:execution_name"` } type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"size:100;primary_key;index"` + NodeID string `gorm:"primary_key;index"` } type NodeExecution struct { @@ -60,10 +60,10 @@ type NodeExecution struct { type TaskExecutionKey struct { TaskKey - Project string `gorm:"size:64;primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"size:100;primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"size:100;primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"size:100;primary_key;index:idx_task_executions_exec;index"` + Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` + Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` + Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` + NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` From 93864e6430198787756e04c4b495f8c29b96f8d5 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:29:33 -0700 Subject: [PATCH 21/37] Drop remaining size statements from `migration_models.go` Signed-off-by: eduardo apolinario --- pkg/repositories/config/migration_models.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/repositories/config/migration_models.go b/pkg/repositories/config/migration_models.go index 712580b1d..4c0144697 100644 --- a/pkg/repositories/config/migration_models.go +++ b/pkg/repositories/config/migration_models.go @@ -72,9 +72,9 @@ type TaskExecutionKey struct { type TaskExecution struct { models.BaseModel TaskExecutionKey - Phase string `gorm:"size:100"` + Phase string PhaseVersion uint32 - InputURI string `gorm:"size:100"` + InputURI string Closure []byte StartedAt *time.Time // Corresponds to the CreatedAt field in the TaskExecution closure From 4daf1fe95df488c2f8863a8f5bc379ad3f5ae213 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:31:38 -0700 Subject: [PATCH 22/37] Remove unnecessary gorm statements from `base_model.go` Signed-off-by: eduardo apolinario --- pkg/repositories/models/base_model.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/repositories/models/base_model.go b/pkg/repositories/models/base_model.go index fcfcff428..bfc5776ce 100644 --- a/pkg/repositories/models/base_model.go +++ b/pkg/repositories/models/base_model.go @@ -7,7 +7,7 @@ import "time" // own primary keys rather than use the ID as the primary key type BaseModel struct { ID uint `gorm:"index;autoIncrement"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` + CreatedAt time.Time + UpdatedAt time.Time DeletedAt *time.Time `gorm:"index"` } From 7252d4b377a31265e1bceabb12de11f4df358ac8 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:33:49 -0700 Subject: [PATCH 23/37] Drop unnecessary changes. Signed-off-by: Eduardo Apolinario --- pkg/repositories/models/execution.go | 6 +++--- pkg/repositories/models/node_execution.go | 2 +- pkg/repositories/models/task_execution.go | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/repositories/models/execution.go b/pkg/repositories/models/execution.go index f55b4b914..1c5e1300d 100644 --- a/pkg/repositories/models/execution.go +++ b/pkg/repositories/models/execution.go @@ -11,9 +11,9 @@ import ( // Execution primary key type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` + Project string `gorm:"primary_key;column:execution_project" valid:"length(0|255)"` + Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|255)"` + Name string `gorm:"primary_key;column:execution_name" valid:"length(0|255)"` } // Database model to encapsulate a (workflow) execution. diff --git a/pkg/repositories/models/node_execution.go b/pkg/repositories/models/node_execution.go index a26d85d1e..100ab557c 100644 --- a/pkg/repositories/models/node_execution.go +++ b/pkg/repositories/models/node_execution.go @@ -9,7 +9,7 @@ import ( type NodeExecutionKey struct { ExecutionKey - NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` + NodeID string `gorm:"primary_key;index" valid:"length(0|255)"` } // By convention, gorm foreign key references are of the form {ModelName}ID diff --git a/pkg/repositories/models/task_execution.go b/pkg/repositories/models/task_execution.go index 1f5717481..d1f8ad243 100644 --- a/pkg/repositories/models/task_execution.go +++ b/pkg/repositories/models/task_execution.go @@ -6,8 +6,6 @@ import ( // IMPORTANT: If you update the model below, be sure to double check model definitions in // pkg/repositories/config/migration_models.go -// -// TODO: why do we have copies of the models present in this file in pkg/repositories/config/migration_models.go? // Task execution primary key type TaskExecutionKey struct { From 180715c9697a177890401df33a3d177c87ac795f Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:36:49 -0700 Subject: [PATCH 24/37] Remove unnecessary changes Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migrations.go | 396 -------------------------- 1 file changed, 396 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 5bc8e70e1..6cf17eff1 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1508,399 +1508,3 @@ func alterTableColumnType(db *sql.DB, columnName, columnType string) error { } return nil } - -// func alterTableColumnTypeGorm(tx *gorm.DB, columnName, columnType string) error { -// for tableName, model := range gorm_models { -// if tx.Model(model).Migrator().HasColumn(model, "columnName") { -// tx.Migrator().MigrateColumn(model, field *schema.Field, columnType gorm.ColumnType) -// } -// } -// } - -var Migrations = []*gormigrate.Migration{ - /* The following is a series of Postgres specific migrations. They should mirror the state - of the database as of 2023 March. The rollback is a noop for everything because the migration itself should - be a noop. - */ - // need to add not null, re-running old migrations now seems to drop the not null constraint on ID. - - { - ID: "pg-noop-2023-03-31-noop-project-3", - Migrate: func(tx *gorm.DB) error { - type Project struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Identifier string `gorm:"primary_key"` - Name string `valid:"length(0|255)"` // Human-readable name, not a unique identifier. - Description string `gorm:"type:varchar(300)"` - Labels []byte - // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0;index"` - } - return tx.AutoMigrate(&Project{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - // ALTER TABLE "projects" ALTER COLUMN "id" DROP NOT NULL otherwise. - - { - ID: "pg-noop-2023-03-31-noop-task-2", - Migrate: func(tx *gorm.DB) error { - type Task struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:task_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key" valid:"length(0|255)"` - Closure []byte `gorm:"not null"` - // Hash of the compiled task closure - Digest []byte - // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"" valid:"length(0|255)"` - // ShortDescription for the task. - ShortDescription string - } - return tx.AutoMigrate(&Task{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-workflow", - Migrate: func(tx *gorm.DB) error { - type Workflow struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:workflow_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key"` - TypedInterface []byte - RemoteClosureIdentifier string `gorm:"not null" valid:"length(0|255)"` - // Hash of the compiled workflow closure - Digest []byte - // ShortDescription for the workflow. - ShortDescription string - } - return tx.AutoMigrate(&Workflow{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-launchplan", - Migrate: func(tx *gorm.DB) error { - type LaunchPlanScheduleType string - - const ( - LaunchPlanScheduleTypeNONE LaunchPlanScheduleType = "NONE" - LaunchPlanScheduleTypeCRON LaunchPlanScheduleType = "CRON" - LaunchPlanScheduleTypeRATE LaunchPlanScheduleType = "RATE" - ) - - type LaunchPlan struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:lp_project_domain_name_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key" valid:"length(0|255)"` - Spec []byte `gorm:"not null"` - WorkflowID uint `gorm:"index"` - Closure []byte `gorm:"not null"` - // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` - // Hash of the launch plan - Digest []byte - ScheduleType LaunchPlanScheduleType - } - return tx.AutoMigrate(&LaunchPlan{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-namedentitymetadata", - Migrate: func(tx *gorm.DB) error { - type NamedEntityMetadata struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - ResourceType core.ResourceType `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Project string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:named_entity_metadata_type_project_domain_name_idx" valid:"length(0|255)"` - Description string `gorm:"type:varchar(300)"` - // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` - } - - return tx.AutoMigrate(&NamedEntityMetadata{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-taskexecution-3", - Migrate: func(tx *gorm.DB) error { - type TaskKey struct { - Project string `gorm:"primary_key"` - Domain string `gorm:"primary_key"` - Name string `gorm:"primary_key"` - Version string `gorm:"primary_key"` - } - type TaskExecutionKey struct { - TaskKey - Project string `gorm:"primary_key;column:execution_project;index:idx_task_executions_exec"` - Domain string `gorm:"primary_key;column:execution_domain;index:idx_task_executions_exec"` - Name string `gorm:"primary_key;column:execution_name;index:idx_task_executions_exec"` - NodeID string `gorm:"primary_key;index:idx_task_executions_exec;index"` - // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. - // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. - RetryAttempt *uint32 `gorm:"primary_key;AUTO_INCREMENT:FALSE"` - } - type TaskExecution struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - TaskExecutionKey - Phase string `gorm:"type:text"` - PhaseVersion uint32 - InputURI string `gorm:"type:text"` - Closure []byte - StartedAt *time.Time - // Corresponds to the CreatedAt field in the TaskExecution closure - // This field is prefixed with TaskExecution because it signifies when - // the execution was createdAt, not to be confused with gorm.Model.CreatedAt - TaskExecutionCreatedAt *time.Time - // Corresponds to the UpdatedAt field in the TaskExecution closure - // This field is prefixed with TaskExecution because it signifies when - // the execution was UpdatedAt, not to be confused with gorm.Model.UpdatedAt - TaskExecutionUpdatedAt *time.Time - Duration time.Duration - // The child node executions (if any) launched by this task execution. - ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` - } - - return tx.AutoMigrate(&TaskExecution{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - // ALTER TABLE "task_executions" ALTER COLUMN "phase" TYPE varchar(100) USING "phase"::varchar(100) - // ALTER TABLE "task_executions" ALTER COLUMN "input_uri" TYPE varchar(100) USING "input_uri"::varchar(100) - - { - ID: "pg-noop-2023-03-31-noop-nodeexecution-2", - Migrate: func(tx *gorm.DB) error { - type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project"` - Domain string `gorm:"primary_key;column:execution_domain"` - Name string `gorm:"primary_key;column:execution_name"` - } - - type NodeExecutionKey struct { - ExecutionKey - NodeID string `gorm:"primary_key;index"` - } - type NodeExecution struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - NodeExecutionKey - // Also stored in the closure, but defined as a separate column because it's useful for filtering and sorting. - Phase string - InputURI string - Closure []byte - StartedAt *time.Time - // Corresponds to the CreatedAt field in the NodeExecution closure - // Prefixed with NodeExecution to avoid clashes with gorm.Model CreatedAt - NodeExecutionCreatedAt *time.Time - // Corresponds to the UpdatedAt field in the NodeExecution closure - // Prefixed with NodeExecution to avoid clashes with gorm.Model UpdatedAt - NodeExecutionUpdatedAt *time.Time - Duration time.Duration - // The task execution (if any) which launched this node execution. - ParentTaskExecutionID uint `sql:"default:null" gorm:"index"` - // The workflow execution (if any) which this node execution launched - LaunchedExecution models.Execution `gorm:"foreignKey:ParentNodeExecutionID;references:ID"` - // In the case of dynamic workflow nodes, the remote closure is uploaded to the path specified here. - DynamicWorkflowRemoteClosureReference string - // Metadata that is only relevant to the flyteadmin service that is used to parse the model and track additional attributes. - InternalData []byte - } - - return tx.AutoMigrate(&NodeExecution{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-execution-event", - Migrate: func(tx *gorm.DB) error { - type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` - } - type ExecutionEvent struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - ExecutionKey - RequestID string `valid:"length(0|255)"` - OccurredAt time.Time - Phase string `gorm:"primary_key"` - } - - return tx.AutoMigrate(&ExecutionEvent{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-node-execution-event", - Migrate: func(tx *gorm.DB) error { - type ExecutionKey struct { - Project string `gorm:"primary_key;column:execution_project" valid:"length(0|127)"` - Domain string `gorm:"primary_key;column:execution_domain" valid:"length(0|127)"` - Name string `gorm:"primary_key;column:execution_name" valid:"length(0|127)"` - } - type NodeExecutionKey struct { - ExecutionKey - NodeID string `gorm:"primary_key;index" valid:"length(0|180)"` - } - type NodeExecutionEvent struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - NodeExecutionKey - RequestID string - OccurredAt time.Time - Phase string `gorm:"primary_key"` - } - - return tx.AutoMigrate(&NodeExecutionEvent{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-description-entity-2", - Migrate: func(tx *gorm.DB) error { - type DescriptionEntityKey struct { - ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Project string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Domain string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Name string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - Version string `gorm:"primary_key;index:description_entity_project_domain_name_version_idx" valid:"length(0|255)"` - } - - // SourceCode Database model to encapsulate a SourceCode. - type SourceCode struct { - Link string `valid:"length(0|255)"` - } - - // DescriptionEntity Database model to encapsulate a DescriptionEntity. - type DescriptionEntity struct { - DescriptionEntityKey - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - SourceCode - ShortDescription string - LongDescription []byte - } - - return tx.AutoMigrate(&DescriptionEntity{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-signal", - Migrate: func(tx *gorm.DB) error { - type SignalKey struct { - ExecutionKey - SignalID string `gorm:"primary_key;index" valid:"length(0|255)"` - } - - type Signal struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - SignalKey - Type []byte `gorm:"not null"` - Value []byte - } - - return tx.AutoMigrate(&Signal{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, - - { - ID: "pg-noop-2023-03-31-noop-resource-3", - Migrate: func(tx *gorm.DB) error { - type ResourcePriority int32 - - // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique - type Resource struct { - ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` - CreatedAt time.Time - UpdatedAt time.Time - DeletedAt *time.Time `sql:"index"` - Project string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Domain string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Workflow string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - LaunchPlan string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - ResourceType string `gorm:"uniqueIndex:resource_idx" valid:"length(0|255)"` - Priority ResourcePriority - // Serialized flyteidl.admin.MatchingAttributes. - Attributes []byte - } - - return tx.AutoMigrate(&Resource{}) - }, - Rollback: func(tx *gorm.DB) error { - return nil - }, - }, -} From 37827b85eaa75eb1f3a2e743ab282e24537015b3 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 17:39:37 -0700 Subject: [PATCH 25/37] Bring `alterTableColumnType` back Signed-off-by: Eduardo Apolinario --- pkg/repositories/config/migrations.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 6cf17eff1..9cafe5ae9 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1497,12 +1497,8 @@ func alterTableColumnType(db *sql.DB, columnName, columnType string) error { var err error for _, table := range tables { - // if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, - // columnType)); err != nil { - // return err - // } - // TODO: figure out how to get the driver name - if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE %s MODIFY COLUMN %s %s`, table, columnName, columnType)); err != nil { + if _, err = db.Exec(fmt.Sprintf(`ALTER TABLE IF EXISTS %s ALTER COLUMN "%s" TYPE %s`, table, columnName, + columnType)); err != nil { return err } } From fe80833919652084c6ae3e56e1826d19369ef0b2 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 18:40:14 -0700 Subject: [PATCH 26/37] Move comment to top of fixup migrations Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 9cafe5ae9..7eaa38491 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -946,8 +946,10 @@ var NoopMigrations = []*gormigrate.Migration{ }, } +// These migrations modify the column types from `text` to a bounded string type (i.e. varchar). +// The idea is to tighten the column types to avoid the performance penalty of using `text`, which in the case of +// MySQL is a `longtext` (4GB) column type. var FixupMigrations = []*gormigrate.Migration{ - // These migrations modify the column types from `text` to a bounded string type (i.e. varchar). { ID: "2023-03-31-fixup-project", Migrate: func(tx *gorm.DB) error { From e31ccd800e0247b4ade0b8128df74b0130265e5d Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 29 Mar 2023 18:43:55 -0700 Subject: [PATCH 27/37] Add separate index to `signals` table Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 7eaa38491..310228f0b 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1390,9 +1390,14 @@ var FixupMigrations = []*gormigrate.Migration{ { ID: "2023-03-31-fixup-signal", Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"size:64;primary_key;column:execution_project"` + Domain string `gorm:"size:64;primary_key;column:execution_domain"` + Name string `gorm:"size:512;primary_key;column:execution_name"` + } type SignalKey struct { ExecutionKey - SignalID string `gorm:"size:255;primary_key;index"` + SignalID string `gorm:"size:255;index"` } type Signal struct { From 8effaf7bce07463a2dd823ec5410a96a4b58a882 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Thu, 30 Mar 2023 13:06:28 -0700 Subject: [PATCH 28/37] Fix one off errors. Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 310228f0b..5e5f7fdda 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1168,7 +1168,7 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time TaskExecutionKey - Phase string `gorm:"size:255"` + Phase string `gorm:"size:50"` PhaseVersion uint32 InputURI string `gorm:"size:2048"` Closure []byte @@ -1393,7 +1393,7 @@ var FixupMigrations = []*gormigrate.Migration{ type ExecutionKey struct { Project string `gorm:"size:64;primary_key;column:execution_project"` Domain string `gorm:"size:64;primary_key;column:execution_domain"` - Name string `gorm:"size:512;primary_key;column:execution_name"` + Name string `gorm:"size:511;primary_key;column:execution_name"` } type SignalKey struct { ExecutionKey @@ -1429,8 +1429,8 @@ var FixupMigrations = []*gormigrate.Migration{ DeletedAt *time.Time `sql:"index"` Project string `gorm:"size:64;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` Domain string `gorm:"size:64;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` - Workflow string `gorm:"size:512;index:idx_project_domain_workflow_resource_type"` - LaunchPlan string `gorm:"size:512;index:idx_project_domain_launchplan_resource_type"` + Workflow string `gorm:"size:511;index:idx_project_domain_workflow_resource_type"` + LaunchPlan string `gorm:"size:511;index:idx_project_domain_launchplan_resource_type"` ResourceType string `gorm:"size:50;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` Priority ResourcePriority // Serialized flyteidl.admin.MatchingAttributes. From 6e34716703d4549c9f84121eb5546d46b742cc1e Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 4 Apr 2023 11:14:05 -0700 Subject: [PATCH 29/37] not null couple columns Signed-off-by: Yee Hing Tong --- pkg/repositories/config/migrations.go | 88 +++++++++++++-------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 5e5f7fdda..a7e2b210b 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -975,19 +975,19 @@ var FixupMigrations = []*gormigrate.Migration{ ID: "2023-03-31-fixup-task", Migrate: func(tx *gorm.DB) error { type Task struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" gorm:""` - Domain string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx"` - Name string `gorm:"size:511;primary_key;index:task_project_domain_name_idx"` - Version string `gorm:"size:128;primary_key"` - Closure []byte `gorm:"not null"` + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" gorm:""` + Domain string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx"` + Name string `gorm:"size:511;primary_key;index:task_project_domain_name_idx"` + Version string `gorm:"size:128;primary_key"` + Closure []byte `gorm:"not null"` // Hash of the compiled task closure Digest []byte // Task type (also stored in the closure put promoted as a column for filtering). - Type string `gorm:"size:255"` + Type string `gorm:"size:255"` // ShortDescription for the task. ShortDescription string `gorm:"size:255"` } @@ -1002,20 +1002,20 @@ var FixupMigrations = []*gormigrate.Migration{ ID: "2023-03-31-fixup-workflow", Migrate: func(tx *gorm.DB) error { type Workflow struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` - Domain string `gorm:"size:64;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` - Name string `gorm:"size:511;primary_key;index:workflow_project_domain_name_idx"` - Version string `gorm:"size:128;primary_key"` + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` + Domain string `gorm:"size:64;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx;not null"` + Name string `gorm:"size:511;primary_key;index:workflow_project_domain_name_idx"` + Version string `gorm:"size:128;primary_key"` TypedInterface []byte - RemoteClosureIdentifier string `gorm:"size:2048;not null"` + RemoteClosureIdentifier string `gorm:"size:2048;not null"` // Hash of the compiled workflow closure Digest []byte // ShortDescription for the workflow. - ShortDescription string `gorm:"size:2048"` + ShortDescription string `gorm:"size:2048"` } return tx.AutoMigrate(&Workflow{}) }, @@ -1026,22 +1026,22 @@ var FixupMigrations = []*gormigrate.Migration{ { ID: "2023-03-31-fixup-launchplan", Migrate: func(tx *gorm.DB) error { - type LaunchPlanScheduleType string + type LaunchPlanScheduleType string type LaunchPlan struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"size:64;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` - Domain string `gorm:"size:64;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` - Name string `gorm:"size:511;primary_key;index:lp_project_domain_name_idx"` - Version string `gorm:"size:128;primary_key"` - Spec []byte `gorm:"not null"` - WorkflowID uint `gorm:"index"` - Closure []byte `gorm:"not null"` + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` + Domain string `gorm:"size:64;primary_key;index:lp_project_domain_name_idx,lp_project_domain_idx"` + Name string `gorm:"size:511;primary_key;index:lp_project_domain_name_idx"` + Version string `gorm:"size:128;primary_key"` + Spec []byte `gorm:"not null"` + WorkflowID uint `gorm:"index"` + Closure []byte `gorm:"not null"` // GORM doesn't save the zero value for ints, so we use a pointer for the State field - State *int32 `gorm:"default:0"` + State *int32 `gorm:"default:0"` // Hash of the launch plan Digest []byte ScheduleType LaunchPlanScheduleType `gorm:"size:255"` @@ -1085,9 +1085,9 @@ var FixupMigrations = []*gormigrate.Migration{ } type Execution struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` ExecutionKey LaunchPlanID uint `gorm:"index"` @@ -1163,10 +1163,10 @@ var FixupMigrations = []*gormigrate.Migration{ RetryAttempt *uint32 `gorm:"index:idx_taskexecutionkey_project_domain_name_nodeid_retry;AUTO_INCREMENT:FALSE"` } type TaskExecution struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time TaskExecutionKey Phase string `gorm:"size:50"` PhaseVersion uint32 @@ -1312,9 +1312,9 @@ var FixupMigrations = []*gormigrate.Migration{ UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` ExecutionKey - RequestID string `gorm:"size:255"` + RequestID string `gorm:"size:255"` OccurredAt time.Time `gorm:"type:time"` - Phase string `gorm:"size:50;primary_key"` + Phase string `gorm:"size:50;primary_key"` } return tx.AutoMigrate(&ExecutionEvent{}) @@ -1358,7 +1358,7 @@ var FixupMigrations = []*gormigrate.Migration{ type DescriptionEntityKey struct { // ResourceType is an enum that indicates the type of the resource. We represent it as an uint32. ResourceType core.ResourceType `gorm:"primary_key;index:description_entity_project_domain_name_version_idx"` - Project string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx"` + Project string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx"` Domain string `gorm:"size:64;primary_key;index:description_entity_project_domain_name_version_idx"` Name string `gorm:"size:511;primary_key;index:description_entity_project_domain_name_version_idx"` Version string `gorm:"size:128;primary_key;index:description_entity_project_domain_name_version_idx"` @@ -1397,7 +1397,7 @@ var FixupMigrations = []*gormigrate.Migration{ } type SignalKey struct { ExecutionKey - SignalID string `gorm:"size:255;index"` + SignalID string `gorm:"size:255;index;not null"` } type Signal struct { From bcc2b9d8a6dc15cbf8a0fbcd049a5fd1b3e31fe6 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 4 Apr 2023 11:56:42 -0700 Subject: [PATCH 30/37] partial treatment of stuff Signed-off-by: Yee Hing Tong --- pkg/repositories/config/migrations.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index a7e2b210b..52c31ee96 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -848,6 +848,12 @@ var NoopMigrations = []*gormigrate.Migration{ { ID: "pg-noop-2023-03-31-noop-signal", Migrate: func(tx *gorm.DB) error { + type ExecutionKey struct { + Project string `gorm:"primary_key;column:execution_project"` + Domain string `gorm:"primary_key;column:execution_domain"` + Name string `gorm:"primary_key;column:execution_name"` + } + type SignalKey struct { ExecutionKey SignalID string `gorm:"primary_key;index" valid:"length(0|255)"` @@ -1397,7 +1403,7 @@ var FixupMigrations = []*gormigrate.Migration{ } type SignalKey struct { ExecutionKey - SignalID string `gorm:"size:255;index;not null"` + SignalID string `gorm:"size:128;primary_key"` } type Signal struct { From 5ccb2956a3730df698613394b670459e80924cce Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 4 Apr 2023 14:00:38 -0700 Subject: [PATCH 31/37] add manual indices for resources and task executions Signed-off-by: Yee Hing Tong --- pkg/repositories/config/migrations.go | 140 ++++++++++++++++++-------- 1 file changed, 96 insertions(+), 44 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 52c31ee96..f74e97e9a 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1007,23 +1007,45 @@ var FixupMigrations = []*gormigrate.Migration{ { ID: "2023-03-31-fixup-workflow", Migrate: func(tx *gorm.DB) error { - type Workflow struct { - ID uint `gorm:"index;autoIncrement;not null"` - CreatedAt time.Time `gorm:"type:time"` - UpdatedAt time.Time `gorm:"type:time"` - DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` - Domain string `gorm:"size:64;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx;not null"` - Name string `gorm:"size:511;primary_key;index:workflow_project_domain_name_idx"` - Version string `gorm:"size:128;primary_key"` - TypedInterface []byte - RemoteClosureIdentifier string `gorm:"size:2048;not null"` - // Hash of the compiled workflow closure - Digest []byte - // ShortDescription for the workflow. - ShortDescription string `gorm:"size:2048"` + if tx.Dialector.Name() == "mysql" { + type Workflow struct { + ID uint `gorm:"primary_key;index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;uniqueIndex:workflow_pdnv;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` + Domain string `gorm:"size:64;uniqueIndex:workflow_pdnv;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx;not null"` + Name string `gorm:"size:511;uniqueIndex:workflow_pdnv;index:workflow_project_domain_name_idx"` + Version string `gorm:"size:128;uniqueIndex:workflow_pdnv"` + TypedInterface []byte + RemoteClosureIdentifier string `gorm:"size:2048;not null"` + // Hash of the compiled workflow closure + Digest []byte + // ShortDescription for the workflow. + ShortDescription string `gorm:"size:2048"` + } + return tx.AutoMigrate(&Workflow{}) + + } else { + type Workflow struct { + ID uint `gorm:"index;autoIncrement;not null"` + CreatedAt time.Time `gorm:"type:time"` + UpdatedAt time.Time `gorm:"type:time"` + DeletedAt *time.Time `gorm:"index"` + Project string `gorm:"size:64;primary_key;index:workflow_project_domain_name_idx;index:workflow_project_domain_idx"` + Domain string `gorm:"size:64;primary_key:workflow_project_domain_name_idx;index:workflow_project_domain_idx;not null"` + Name string `gorm:"size:511;primary_key;index:workflow_project_domain_name_idx"` + Version string `gorm:"size:128;primary_key"` + TypedInterface []byte + RemoteClosureIdentifier string `gorm:"size:2048;not null"` + // Hash of the compiled workflow closure + Digest []byte + // ShortDescription for the workflow. + ShortDescription string `gorm:"size:2048"` + } + return tx.AutoMigrate(&Workflow{}) + } - return tx.AutoMigrate(&Workflow{}) }, Rollback: func(tx *gorm.DB) error { return nil @@ -1153,23 +1175,23 @@ var FixupMigrations = []*gormigrate.Migration{ // on secondary indexes instead. if tx.Dialector.Name() == "mysql" { type TaskKey struct { - Project string `gorm:"size:64;index:idx_taskkey_project_domain_name_version"` - Domain string `gorm:"size:64;index:idx_taskkey_project_domain_name_version"` - Name string `gorm:"size:511;index:idx_taskkey_project_domain_name_version"` - Version string `gorm:"size:128;index:idx_taskkey_project_domain_name_version"` + Project string `gorm:"size:64"` + Domain string `gorm:"size:64"` + Name string `gorm:"size:511"` + Version string `gorm:"size:128"` } type TaskExecutionKey struct { TaskKey - Project string `gorm:"size:64;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;column:execution_project"` - Domain string `gorm:"size:64;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;column:execution_domain"` - Name string `gorm:"size:511;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;column:execution_name"` - NodeID string `gorm:"size:30;index:idx_taskexecutionkey_project_domain_name_nodeid_retry;"` + Project string `gorm:"size:64;index:idx_taskexecutionkey_project_domain_name_nodeid;column:execution_project"` + Domain string `gorm:"size:64;index:idx_taskexecutionkey_project_domain_name_nodeid;column:execution_domain"` + Name string `gorm:"size:511;index:idx_taskexecutionkey_project_domain_name_nodeid;column:execution_name"` + NodeID string `gorm:"size:30;index:idx_taskexecutionkey_project_domain_name_nodeid;"` // *IMPORTANT* This is a pointer to an int in order to allow setting an empty ("0") value according to gorm convention. // Because RetryAttempt is part of the TaskExecution primary key is should *never* be null. - RetryAttempt *uint32 `gorm:"index:idx_taskexecutionkey_project_domain_name_nodeid_retry;AUTO_INCREMENT:FALSE"` + RetryAttempt *uint32 `gorm:"AUTO_INCREMENT:FALSE"` } type TaskExecution struct { - ID uint `gorm:"index;autoIncrement;not null"` + ID uint `gorm:"index;autoIncrement;not null"` // maybe need to add primary key, if not remove from workflows CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time @@ -1193,7 +1215,11 @@ var FixupMigrations = []*gormigrate.Migration{ ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` } - return tx.AutoMigrate(&TaskExecution{}) + err := tx.AutoMigrate(&TaskExecution{}) + if err != nil { + return err + } + return tx.Exec("CREATE INDEX primary_alt ON task_executions(project, domain, name, version, execution_project, execution_domain, execution_name, node_id, retry_attempt);").Error } else { // For all other databases, we can use the primary key as defined in the model. // ** Please, keep the model definitions in sync with the mysql ones defined above. ** @@ -1425,25 +1451,51 @@ var FixupMigrations = []*gormigrate.Migration{ { ID: "2023-03-31-fixup-resource", Migrate: func(tx *gorm.DB) error { - type ResourcePriority int32 + if tx.Dialector.Name() == "mysql" { + type ResourcePriority int32 + + // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique + type Resource struct { + ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time `sql:"index"` + Project string `gorm:"size:64"` + Domain string `gorm:"size:64"` + Workflow string `gorm:"size:511"` + LaunchPlan string `gorm:"size:511"` + ResourceType string `gorm:"size:50"` + Priority ResourcePriority + // Serialized flyteidl.admin.MatchingAttributes. + Attributes []byte + } - // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique - type Resource struct { - ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` - CreatedAt time.Time - UpdatedAt time.Time - DeletedAt *time.Time `sql:"index"` - Project string `gorm:"size:64;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` - Domain string `gorm:"size:64;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` - Workflow string `gorm:"size:511;index:idx_project_domain_workflow_resource_type"` - LaunchPlan string `gorm:"size:511;index:idx_project_domain_launchplan_resource_type"` - ResourceType string `gorm:"size:50;index:idx_project_domain_workflow_resource_type;index:idx_project_domain_launchplan_resource_type"` - Priority ResourcePriority - // Serialized flyteidl.admin.MatchingAttributes. - Attributes []byte - } + err := tx.AutoMigrate(&Resource{}) + if err != nil { + return err + } + return tx.Exec("CREATE INDEX primary_alt ON resources(project, domain, workflow(200), launch_plan(200), resource_type);").Error + } else { + type ResourcePriority int32 + + // In this model, the combination of (Project, Domain, Workflow, LaunchPlan, ResourceType) is unique + type Resource struct { + ID int64 `gorm:"AUTO_INCREMENT;column:id;primary_key;not null"` + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time `sql:"index"` + Project string `gorm:"size:64;uniqueIndex:idx_project_domain_workflow_resource_type"` + Domain string `gorm:"size:64;uniqueIndex:idx_project_domain_workflow_resource_type"` + Workflow string `gorm:"size:511;uniqueIndex:idx_project_domain_workflow_resource_type"` + LaunchPlan string `gorm:"size:511;uniqueIndex:idx_project_domain_workflow_resource_type"` + ResourceType string `gorm:"size:50;uniqueIndex:idx_project_domain_workflow_resource_type"` + Priority ResourcePriority + // Serialized flyteidl.admin.MatchingAttributes. + Attributes []byte + } - return tx.AutoMigrate(&Resource{}) + return tx.AutoMigrate(&Resource{}) + } }, Rollback: func(tx *gorm.DB) error { return nil From 6cae7001aa5b695485f04d432004cd2a3ddc262c Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Tue, 4 Apr 2023 15:50:43 -0700 Subject: [PATCH 32/37] Set prefix length in `primary_alt` index on `task_executions` table Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index f74e97e9a..87532a53c 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1219,7 +1219,7 @@ var FixupMigrations = []*gormigrate.Migration{ if err != nil { return err } - return tx.Exec("CREATE INDEX primary_alt ON task_executions(project, domain, name, version, execution_project, execution_domain, execution_name, node_id, retry_attempt);").Error + return tx.Exec("CREATE INDEX primary_alt ON task_executions(project, domain, name(200), version, execution_project, execution_domain, execution_name(128), node_id, retry_attempt);").Error } else { // For all other databases, we can use the primary key as defined in the model. // ** Please, keep the model definitions in sync with the mysql ones defined above. ** From e7361cc50ba76efe6037154a6a3e4658a98af2b5 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Tue, 4 Apr 2023 16:03:47 -0700 Subject: [PATCH 33/37] Separate creation of `primary_alt` indexes into their own migrations. Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 42 ++++++++++++++++++++------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 87532a53c..7b6b4d607 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1215,11 +1215,7 @@ var FixupMigrations = []*gormigrate.Migration{ ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` } - err := tx.AutoMigrate(&TaskExecution{}) - if err != nil { - return err - } - return tx.Exec("CREATE INDEX primary_alt ON task_executions(project, domain, name(200), version, execution_project, execution_domain, execution_name(128), node_id, retry_attempt);").Error + return tx.AutoMigrate(&TaskExecution{}) } else { // For all other databases, we can use the primary key as defined in the model. // ** Please, keep the model definitions in sync with the mysql ones defined above. ** @@ -1271,6 +1267,21 @@ var FixupMigrations = []*gormigrate.Migration{ return nil }, }, + { + ID: "2023-03-31-fixup-task_executions_create_primary_alt_index", + Migrate: func(tx *gorm.DB) error { + // This migration only applies to mysql as it has a limit on the size of the index. + // For other databases, we can use the primary key as defined in the model. + // ** Please, keep the model definitions in sync with the mysql ones defined above. ** + if tx.Dialector.Name() == "mysql" { + return tx.Exec("CREATE INDEX primary_alt ON task_executions(project, domain, name(200), version, execution_project, execution_domain, execution_name(128), node_id, retry_attempt);").Error + } + return nil + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, { ID: "2023-03-31-fixup-nodeexecution", Migrate: func(tx *gorm.DB) error { @@ -1470,11 +1481,7 @@ var FixupMigrations = []*gormigrate.Migration{ Attributes []byte } - err := tx.AutoMigrate(&Resource{}) - if err != nil { - return err - } - return tx.Exec("CREATE INDEX primary_alt ON resources(project, domain, workflow(200), launch_plan(200), resource_type);").Error + return tx.AutoMigrate(&Resource{}) } else { type ResourcePriority int32 @@ -1501,6 +1508,21 @@ var FixupMigrations = []*gormigrate.Migration{ return nil }, }, + { + ID: "2023-03-31-fixup-resources_create_primary_alt_index", + Migrate: func(tx *gorm.DB) error { + // This migration only applies to mysql as it has a limit on the size of the index. + // For other databases, we can use the primary key as defined in the model. + // ** Please, keep the model definitions in sync with the mysql ones defined above. ** + if tx.Dialector.Name() != "mysql" { + return tx.Exec("CREATE INDEX primary_alt ON resources(project, domain, workflow(200), launch_plan(200), resource_type);").Error + } + return nil + }, + Rollback: func(tx *gorm.DB) error { + return nil + }, + }, { ID: "2023-03-31-fixup-schedulable_entities", Migrate: func(tx *gorm.DB) error { From ef4f5e7c190901e8edebc1f88d2f0917b80d4f3c Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 18 Apr 2023 12:33:25 -0700 Subject: [PATCH 34/37] use latest stdlib branch Signed-off-by: Yee Hing Tong --- go.mod | 4 ++-- go.sum | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a9359eb7a..54a8160e2 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/flyteorg/flyteidl v1.3.13 github.com/flyteorg/flyteplugins v1.0.40 github.com/flyteorg/flytepropeller v1.1.70 - github.com/flyteorg/flytestdlib v1.0.15 + github.com/flyteorg/flytestdlib v1.0.17-0.20230320195919-90331d171e2a github.com/flyteorg/stow v0.3.6 github.com/ghodss/yaml v1.0.0 github.com/go-gormigrate/gormigrate/v2 v2.0.0 @@ -210,4 +210,4 @@ require ( replace github.com/robfig/cron/v3 => github.com/unionai/cron/v3 v3.0.2-0.20210825070134-bfc34418fe84 -replace github.com/flyteorg/flytestdlib => ../flytestdlib +//replace github.com/flyteorg/flytestdlib => github.com/flyteorg/flytestdlib@mysql-support diff --git a/go.sum b/go.sum index a9237b4fa..78ce966a0 100644 --- a/go.sum +++ b/go.sum @@ -318,6 +318,8 @@ github.com/flyteorg/flyteplugins v1.0.40 h1:RTsYingqmqr13qBbi4CB2ArXDHNHUOkAF+HT github.com/flyteorg/flyteplugins v1.0.40/go.mod h1:qyUPqVspLcLGJpKxVwHDWf+kBpOGuItOxCaF6zAmDio= github.com/flyteorg/flytepropeller v1.1.70 h1:/d1qqz13rdVADM85ST70eerAdBstJJz9UUB/mNSZi0w= github.com/flyteorg/flytepropeller v1.1.70/go.mod h1:MezHUJmgPzm4Pu8nIy6LLiEkxNA6buTQ7hInSqCViTY= +github.com/flyteorg/flytestdlib v1.0.17-0.20230320195919-90331d171e2a h1:WQTudPI+ysEkMp648YDm8lbrVFh0sE5K5zuwjFNB37Y= +github.com/flyteorg/flytestdlib v1.0.17-0.20230320195919-90331d171e2a/go.mod h1:TcKdywJD/EokpPaTeRyn0rY0ErXKPzSsg0JKd4U0xDg= github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk= github.com/flyteorg/stow v0.3.6/go.mod h1:5dfBitPM004dwaZdoVylVjxFT4GWAgI0ghAndhNUzCo= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= From 29c702cff0ba0a1fbc05c33bc9a20d73a5e4e801 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 18 Apr 2023 12:49:22 -0700 Subject: [PATCH 35/37] propeller to 1.1.83 Signed-off-by: Yee Hing Tong --- go.mod | 6 +++--- go.sum | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 54a8160e2..bb4f0bfd7 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,9 @@ require ( github.com/cloudevents/sdk-go/v2 v2.8.0 github.com/coreos/go-oidc v2.2.1+incompatible github.com/evanphx/json-patch v4.12.0+incompatible - github.com/flyteorg/flyteidl v1.3.13 - github.com/flyteorg/flyteplugins v1.0.40 - github.com/flyteorg/flytepropeller v1.1.70 + github.com/flyteorg/flyteidl v1.3.14 + github.com/flyteorg/flyteplugins v1.0.49 + github.com/flyteorg/flytepropeller v1.1.83 github.com/flyteorg/flytestdlib v1.0.17-0.20230320195919-90331d171e2a github.com/flyteorg/stow v0.3.6 github.com/ghodss/yaml v1.0.0 diff --git a/go.sum b/go.sum index 78ce966a0..a70ed705e 100644 --- a/go.sum +++ b/go.sum @@ -314,10 +314,14 @@ github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8S github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flyteorg/flyteidl v1.3.13 h1:jOjiHl6jmSCOGC094QaRdSjjhThhzYPm0jHSxwAZ6UM= github.com/flyteorg/flyteidl v1.3.13/go.mod h1:Pkt2skI1LiHs/2ZoekBnyPhuGOFMiuul6HHcKGZBsbM= +github.com/flyteorg/flyteidl v1.3.14/go.mod h1:Pkt2skI1LiHs/2ZoekBnyPhuGOFMiuul6HHcKGZBsbM= github.com/flyteorg/flyteplugins v1.0.40 h1:RTsYingqmqr13qBbi4CB2ArXDHNHUOkAF+HTLJQiQ/s= github.com/flyteorg/flyteplugins v1.0.40/go.mod h1:qyUPqVspLcLGJpKxVwHDWf+kBpOGuItOxCaF6zAmDio= +github.com/flyteorg/flyteplugins v1.0.49/go.mod h1:ztsonku5fKwyxcIg1k69PTiBVjRI6d3nK5DnC+iwx08= github.com/flyteorg/flytepropeller v1.1.70 h1:/d1qqz13rdVADM85ST70eerAdBstJJz9UUB/mNSZi0w= github.com/flyteorg/flytepropeller v1.1.70/go.mod h1:MezHUJmgPzm4Pu8nIy6LLiEkxNA6buTQ7hInSqCViTY= +github.com/flyteorg/flytepropeller v1.1.83 h1:p8pGSPSgjoU1UV23qXtJdB/cmFS92ATHTg1qx3FDkeI= +github.com/flyteorg/flytepropeller v1.1.83/go.mod h1:WFIzp4MhTLpco4YLXBqcaz0qeEchnstwOWiXN15AwkI= github.com/flyteorg/flytestdlib v1.0.17-0.20230320195919-90331d171e2a h1:WQTudPI+ysEkMp648YDm8lbrVFh0sE5K5zuwjFNB37Y= github.com/flyteorg/flytestdlib v1.0.17-0.20230320195919-90331d171e2a/go.mod h1:TcKdywJD/EokpPaTeRyn0rY0ErXKPzSsg0JKd4U0xDg= github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk= From e8a0349eff020b329c2f27ef84cad105707c9407 Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Tue, 18 Apr 2023 14:31:47 -0700 Subject: [PATCH 36/37] == Signed-off-by: Yee Hing Tong --- pkg/repositories/config/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index 7b6b4d607..cfe2c7069 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -1514,7 +1514,7 @@ var FixupMigrations = []*gormigrate.Migration{ // This migration only applies to mysql as it has a limit on the size of the index. // For other databases, we can use the primary key as defined in the model. // ** Please, keep the model definitions in sync with the mysql ones defined above. ** - if tx.Dialector.Name() != "mysql" { + if tx.Dialector.Name() == "mysql" { return tx.Exec("CREATE INDEX primary_alt ON resources(project, domain, workflow(200), launch_plan(200), resource_type);").Error } return nil From ce1773a5be8a53359ac6b823754b53155b0d381c Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Wed, 19 Apr 2023 15:23:21 -0700 Subject: [PATCH 37/37] Add statements to change the type of primary keys in the case of postgres. Signed-off-by: eduardo apolinario --- pkg/repositories/config/migrations.go | 329 ++++++++++++++++++++++++-- 1 file changed, 315 insertions(+), 14 deletions(-) diff --git a/pkg/repositories/config/migrations.go b/pkg/repositories/config/migrations.go index cfe2c7069..14636be67 100644 --- a/pkg/repositories/config/migrations.go +++ b/pkg/repositories/config/migrations.go @@ -971,7 +971,18 @@ var FixupMigrations = []*gormigrate.Migration{ // GORM doesn't save the zero value for ints, so we use a pointer for the State field State *int32 `gorm:"default:0;index"` } - return tx.AutoMigrate(&Project{}) + err := tx.AutoMigrate(&Project{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE projects ALTER COLUMN identifier TYPE varchar(64)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -985,7 +996,7 @@ var FixupMigrations = []*gormigrate.Migration{ CreatedAt time.Time `gorm:"type:time"` UpdatedAt time.Time `gorm:"type:time"` DeletedAt *time.Time `gorm:"index"` - Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" gorm:""` + Project string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx" ` Domain string `gorm:"size:64;primary_key;index:task_project_domain_name_idx;index:task_project_domain_idx"` Name string `gorm:"size:511;primary_key;index:task_project_domain_name_idx"` Version string `gorm:"size:128;primary_key"` @@ -998,7 +1009,30 @@ var FixupMigrations = []*gormigrate.Migration{ ShortDescription string `gorm:"size:255"` } - return tx.AutoMigrate(&Task{}) + err := tx.AutoMigrate(&Task{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE tasks ALTER COLUMN project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE tasks ALTER COLUMN domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE tasks ALTER COLUMN name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE tasks ALTER COLUMN version TYPE varchar(128)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1043,8 +1077,31 @@ var FixupMigrations = []*gormigrate.Migration{ // ShortDescription for the workflow. ShortDescription string `gorm:"size:2048"` } - return tx.AutoMigrate(&Workflow{}) + err := tx.AutoMigrate(&Workflow{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE workflows ALTER COLUMN project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE workflows ALTER COLUMN domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE workflows ALTER COLUMN name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE workflows ALTER COLUMN version TYPE varchar(128)").Error + if err != nil { + return err + } + } + return nil } }, Rollback: func(tx *gorm.DB) error { @@ -1074,7 +1131,30 @@ var FixupMigrations = []*gormigrate.Migration{ Digest []byte ScheduleType LaunchPlanScheduleType `gorm:"size:255"` } - return tx.AutoMigrate(&LaunchPlan{}) + err := tx.AutoMigrate(&LaunchPlan{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE launch_plans ALTER COLUMN project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE launch_plans ALTER COLUMN domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE launch_plans ALTER COLUMN name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE launch_plans ALTER COLUMN version TYPE varchar(128)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1097,7 +1177,26 @@ var FixupMigrations = []*gormigrate.Migration{ State *int32 `gorm:"default:0"` } - return tx.AutoMigrate(&NamedEntityMetadata{}) + err := tx.AutoMigrate(&NamedEntityMetadata{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE named_entity_metadata ALTER COLUMN project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE named_entity_metadata ALTER COLUMN domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE named_entity_metadata ALTER COLUMN name TYPE varchar(511)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1160,7 +1259,27 @@ var FixupMigrations = []*gormigrate.Migration{ LaunchEntity string `gorm:"size:128"` } - return tx.AutoMigrate(&Execution{}) + err := tx.AutoMigrate(&Execution{}) + if err != nil { + return err + } + + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE executions ALTER COLUMN execution_project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE executions ALTER COLUMN execution_domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE executions ALTER COLUMN execution_name TYPE varchar(511)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1260,7 +1379,47 @@ var FixupMigrations = []*gormigrate.Migration{ ChildNodeExecution []NodeExecution `gorm:"foreignkey:ParentTaskExecutionID;references:ID"` } - return tx.AutoMigrate(&TaskExecution{}) + err := tx.AutoMigrate(&TaskExecution{}) + if err != nil { + return err + } + + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN version TYPE varchar(128)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN execution_project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN execution_domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN execution_name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE task_executions ALTER COLUMN node_id TYPE varchar(30)").Error + if err != nil { + return err + } + } + return nil } }, Rollback: func(tx *gorm.DB) error { @@ -1335,7 +1494,30 @@ var FixupMigrations = []*gormigrate.Migration{ CacheStatus *string `gorm:"size:255"` } - return tx.AutoMigrate(&NodeExecution{}) + err := tx.AutoMigrate(&NodeExecution{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE node_executions ALTER COLUMN execution_project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE node_executions ALTER COLUMN execution_domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE node_executions ALTER COLUMN execution_name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE node_executions ALTER COLUMN node_id TYPE varchar(30)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1360,7 +1542,30 @@ var FixupMigrations = []*gormigrate.Migration{ Phase string `gorm:"size:50;primary_key"` } - return tx.AutoMigrate(&ExecutionEvent{}) + err := tx.AutoMigrate(&ExecutionEvent{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE execution_events ALTER COLUMN execution_project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE execution_events ALTER COLUMN execution_domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE execution_events ALTER COLUMN execution_name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE execution_events ALTER COLUMN phase TYPE varchar(50)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1389,7 +1594,34 @@ var FixupMigrations = []*gormigrate.Migration{ Phase string `gorm:"size:50;primary_key"` } - return tx.AutoMigrate(&NodeExecutionEvent{}) + err := tx.AutoMigrate(&NodeExecutionEvent{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE node_execution_events ALTER COLUMN execution_project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE node_execution_events ALTER COLUMN execution_domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE node_execution_events ALTER COLUMN execution_name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE node_execution_events ALTER COLUMN node_id TYPE varchar(30)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE node_execution_events ALTER COLUMN phase TYPE varchar(50)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1424,7 +1656,30 @@ var FixupMigrations = []*gormigrate.Migration{ LongDescription []byte } - return tx.AutoMigrate(&DescriptionEntity{}) + err := tx.AutoMigrate(&DescriptionEntity{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE description_entities ALTER COLUMN project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE description_entities ALTER COLUMN domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE description_entities ALTER COLUMN name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE description_entities ALTER COLUMN version TYPE varchar(128)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1453,7 +1708,30 @@ var FixupMigrations = []*gormigrate.Migration{ Value []byte } - return tx.AutoMigrate(&Signal{}) + err := tx.AutoMigrate(&Signal{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE signals ALTER COLUMN execution_project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE signals ALTER COLUMN execution_domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE signals ALTER COLUMN execution_name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE signals ALTER COLUMN signal_id TYPE varchar(128)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil @@ -1545,7 +1823,30 @@ var FixupMigrations = []*gormigrate.Migration{ Active *bool } - return tx.AutoMigrate(&SchedulableEntity{}) + err := tx.AutoMigrate(&SchedulableEntity{}) + if err != nil { + return err + } + // Run manual migrations for the primary key columns in the case of postgres + if tx.Dialector.Name() == "postgres" { + err = tx.Exec("ALTER TABLE schedulable_entities ALTER COLUMN project TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE schedulable_entities ALTER COLUMN domain TYPE varchar(64)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE schedulable_entities ALTER COLUMN name TYPE varchar(511)").Error + if err != nil { + return err + } + err = tx.Exec("ALTER TABLE schedulable_entities ALTER COLUMN version TYPE varchar(128)").Error + if err != nil { + return err + } + } + return nil }, Rollback: func(tx *gorm.DB) error { return nil