Skip to content

Commit

Permalink
✨ Add builder and builder logs table
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone committed Aug 2, 2023
1 parent 67def8a commit a1d0fc7
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 42 deletions.
2 changes: 1 addition & 1 deletion cmd/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (b Builder) initToken() error {
btConfig.Workers.OCI.Snapshotter = "auto"
btConfig.Workers.OCI.NoProcessSandbox = true
btConfig.Workers.OCI.GC = ptr.Of(true)
btConfig.Workers.OCI.GCKeepStorage = 10 << 30 // 10GB
btConfig.Workers.OCI.GCKeepStorage.Bytes = 10 << 30 // 10GB
btConfig.Workers.OCI.MaxParallelism = 4
btConfig.Workers.OCI.CNIPoolSize = 16
btConfig.Workers.OCI.Rootless = true
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.19
require (
github.com/BurntSushi/toml v1.3.2
github.com/alicebob/miniredis/v2 v2.30.4
github.com/anchore/syft v0.85.0
github.com/aquasecurity/trivy v0.43.1
github.com/aws/aws-sdk-go v1.44.312
github.com/anchore/syft v0.86.1
github.com/aquasecurity/trivy v0.44.0
github.com/aws/aws-sdk-go v1.44.314
github.com/bytedance/sonic v1.9.2
github.com/caarlos0/env/v9 v9.0.0
github.com/casbin/casbin/v2 v2.73.0
Expand All @@ -33,12 +33,12 @@ require (
github.com/labstack/echo/v4 v4.11.1
github.com/matoous/go-nanoid v1.5.0
github.com/matoous/go-nanoid/v2 v2.0.0
github.com/moby/buildkit v0.11.6
github.com/moby/buildkit v0.12.0
github.com/opencontainers/distribution-spec/specs-go v0.0.0-20230727214836-6bc87156eacf
github.com/opencontainers/go-digest v1.0.0
github.com/redis/go-redis/v9 v9.0.5
github.com/rs/zerolog v1.30.0
github.com/shirou/gopsutil/v3 v3.23.6
github.com/shirou/gopsutil/v3 v3.23.7
github.com/smartystreets/goconvey v1.8.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
Expand All @@ -50,7 +50,7 @@ require (
github.com/wagslane/go-password-validator v0.3.0
go.uber.org/mock v0.2.0
golang.org/x/crypto v0.11.0
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
golang.org/x/oauth2 v0.10.0
gorm.io/driver/mysql v1.5.1
gorm.io/driver/postgres v1.5.2
Expand All @@ -72,9 +72,9 @@ require (
github.com/anchore/go-logger v0.0.0-20230627193650-d65da4224867 // indirect
github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9 // indirect
github.com/anchore/packageurl-go v0.1.1-0.20230104203445-02e0a6721501 // indirect
github.com/anchore/stereoscope v0.0.0-20230627195312-cd49355d934e // indirect
github.com/anchore/stereoscope v0.0.0-20230727211946-d1f3d766295e // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/aquasecurity/trivy-db v0.0.0-20230703082116-dc52e83376ce // indirect
github.com/aquasecurity/trivy-db v0.0.0-20230726112157-167ba4f2faeb // indirect
github.com/becheran/wildmatch-go v1.0.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand All @@ -86,8 +86,8 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v24.0.4+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/docker v24.0.5+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
Expand Down Expand Up @@ -169,7 +169,7 @@ require (
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smarty/assertions v1.15.0 // indirect
github.com/spdx/tools-golang v0.5.2 // indirect
github.com/spdx/tools-golang v0.5.3 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand Down
45 changes: 22 additions & 23 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,26 +93,26 @@ github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9/go.mod
github.com/anchore/go-testutils v0.0.0-20200925183923-d5f45b0d3c04 h1:VzprUTpc0vW0nnNKJfJieyH/TZ9UYAnTZs5/gHTdAe8=
github.com/anchore/packageurl-go v0.1.1-0.20230104203445-02e0a6721501 h1:AV7qjwMcM4r8wFhJq3jLRztew3ywIyPTRapl2T1s9o8=
github.com/anchore/packageurl-go v0.1.1-0.20230104203445-02e0a6721501/go.mod h1:Blo6OgJNiYF41ufcgHKkbCKF2MDOMlrqhXv/ij6ocR4=
github.com/anchore/stereoscope v0.0.0-20230627195312-cd49355d934e h1:zhk3ZLtomMJ750nNCE+c24PonMzoO/SeL/4uTr1L9kM=
github.com/anchore/stereoscope v0.0.0-20230627195312-cd49355d934e/go.mod h1:0LsgHgXO4QFnk2hsYwtqd3fR18PIZXlFLIl2qb9tu3g=
github.com/anchore/syft v0.85.0 h1:JShy/YIqffcIR3cvssABGr/yNDRCgZwpcQPcRLO2nHc=
github.com/anchore/syft v0.85.0/go.mod h1:nCMEh98C1BEfkH49HXKeJNPcUEfDM4B6xmptGT5Lv3Q=
github.com/anchore/stereoscope v0.0.0-20230727211946-d1f3d766295e h1:S6IhYpsBCpvphlHA1tN0glSG/kjVvFzC6OJuU2qW5Pc=
github.com/anchore/stereoscope v0.0.0-20230727211946-d1f3d766295e/go.mod h1:0LsgHgXO4QFnk2hsYwtqd3fR18PIZXlFLIl2qb9tu3g=
github.com/anchore/syft v0.86.1 h1:XYD1iBbLekkyWvpmZoWQAdVYUJT1S0OPqCTlfr3WWk0=
github.com/anchore/syft v0.86.1/go.mod h1:I0dtaA+YkEMEGPqc5ho3Q8VxoRgg4fmvHZ44m0OvFPs=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/aquasecurity/trivy v0.43.1 h1:p1zxj4OQ4GfYsQnJsSl13B1LRmfhp1ahSEmS7uTnVQQ=
github.com/aquasecurity/trivy v0.43.1/go.mod h1:q5xIkiurEA6+Ht9cs3Ut85vzUBq4y1N4s7r9AvloEcQ=
github.com/aquasecurity/trivy-db v0.0.0-20230703082116-dc52e83376ce h1:swoQLWQoZ4HW13XeEji217TTcgi61MuMZdsKrqSTE0A=
github.com/aquasecurity/trivy-db v0.0.0-20230703082116-dc52e83376ce/go.mod h1:cXuqKo+FaMY0ixJNoUcyDHdfCBRPWOysI2Td8N4fRsg=
github.com/aquasecurity/trivy v0.44.0 h1:g7vC3di5S2CrnJw0zBmf+CU8Kgrt9zq+Zj5ji99Q7bc=
github.com/aquasecurity/trivy v0.44.0/go.mod h1:OTjCAcrU3eTA10Xt4d4P6EJkBXPWPxBCXA4NaX3gEQ8=
github.com/aquasecurity/trivy-db v0.0.0-20230726112157-167ba4f2faeb h1:uz2+9G7E0/mjf5Q0MB/BwbpdObU34CKGUdnypTYWTfs=
github.com/aquasecurity/trivy-db v0.0.0-20230726112157-167ba4f2faeb/go.mod h1:st35g9O0ecDGBqnRHNFFz8imlDD3GWTCwo1WyJixI2c=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
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/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k=
github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.314 h1:d/5Jyk/Fb+PBd/4nzQg0JuC2W4A0knrDIzBgK/ggAow=
github.com/aws/aws-sdk-go v1.44.314/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/becheran/wildmatch-go v1.0.0 h1:mE3dGGkTmpKtT4Z+88t8RStG40yN9T+kFEGj2PZFSzA=
github.com/becheran/wildmatch-go v1.0.0/go.mod h1:gbMvj0NtVdJ15Mg/mH9uxk2R1QCistMyU7d9KFzroX4=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -199,10 +199,10 @@ github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rM
github.com/docker/cli v24.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.4+incompatible h1:s/LVDftw9hjblvqIeTiGYXBCD95nOEEl7qRsRrIOuQI=
github.com/docker/docker v24.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/docker/docker v24.0.5+incompatible h1:WmgcE4fxyI6EEXxBRxsHnZXrO1pQ3smi0k/jho4HLeY=
github.com/docker/docker v24.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down Expand Up @@ -655,8 +655,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/buildkit v0.11.6 h1:VYNdoKk5TVxN7k4RvZgdeM4GOyRvIi4Z8MXOY7xvyUs=
github.com/moby/buildkit v0.11.6/go.mod h1:GCqKfHhz+pddzfgaR7WmHVEE3nKKZMMDPpK8mh3ZLv4=
github.com/moby/buildkit v0.12.0 h1:hgPDVSeondFLb28cBtRR5O0N4t8uWGJ4YNukT2aICIs=
github.com/moby/buildkit v0.12.0/go.mod h1:+n9GmkxwBCjVz4u7wmiyh+oqvjIjQM+1zk3iJrWfdos=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -758,8 +758,8 @@ github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/shirou/gopsutil/v3 v3.23.6 h1:5y46WPI9QBKBbK7EEccUPNXpJpNrvPuTD0O2zHEHT08=
github.com/shirou/gopsutil/v3 v3.23.6/go.mod h1:j7QX50DrXYggrpN30W0Mo+I4/8U2UUIQrnrhqUeWrAU=
github.com/shirou/gopsutil/v3 v3.23.7 h1:C+fHO8hfIppoJ1WdsVm1RoI0RwXoNdfTK7yWXV0wVj4=
github.com/shirou/gopsutil/v3 v3.23.7/go.mod h1:c4gnmoRC0hQuaLqvxnx1//VXQ0Ms/X9UnJF8pddY5z4=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
Expand All @@ -779,8 +779,8 @@ github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sS
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM=
github.com/spdx/tools-golang v0.5.2 h1:dtMNjJreWPe37584ajk7m/rQtfJaLpRMk7pUGgvekOg=
github.com/spdx/tools-golang v0.5.2/go.mod h1:/ETOahiAo96Ob0/RAIBmFZw6XN0yTnyr/uFZm2NTMhI=
github.com/spdx/tools-golang v0.5.3 h1:ialnHeEYUC4+hkm5vJm4qz2x+oEJbS0mAMFrNXdQraY=
github.com/spdx/tools-golang v0.5.3/go.mod h1:/ETOahiAo96Ob0/RAIBmFZw6XN0yTnyr/uFZm2NTMhI=
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
Expand Down Expand Up @@ -951,8 +951,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 h1:/yRP+0AN7mf5DkD3BAI6TOFnd51gEoDEb8o35jIFtgw=
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b h1:r+vk0EmXNmekl0S0BascoeeoHk/L7wmaW2QF90K+kYI=
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down Expand Up @@ -1167,7 +1167,6 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
Expand Down
4 changes: 4 additions & 0 deletions pkg/consts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const (
// BlobUploads represent blob uploads
// file always represent like: blob_uploads/{upload_id}
BlobUploads = "blob_uploads"
// BlobUploadParts represent blob upload parts
BlobUploadParts = "blob_upload_parts"
// BuilderLogs represent builder logs
BuilderLogs = "builder_logs"
// DefaultTimePattern time pattern
DefaultTimePattern = "2006-01-02 15:04:05"
// ContextJti represents jti in context
Expand Down
14 changes: 11 additions & 3 deletions pkg/dal/migrations/mysql/0001_initialize.down.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ DROP TABLE IF EXISTS `namespaces`;

DROP TABLE IF EXISTS `repositories`;

DROP TABLE IF EXISTS `repository_tags`;

DROP TABLE IF EXISTS `artifacts`;

DROP TABLE IF EXISTS `tags`;
Expand All @@ -26,5 +24,15 @@ DROP TABLE IF EXISTS `proxy_artifact_blobs`;

DROP TABLE IF EXISTS `proxy_tag_tasks`;

DROP TABLE IF EXISTS `casbin_rules`;
DROP TABLE IF EXISTS `audits`;

DROP TABLE IF EXISTS `daemon_logs`;

DROP TABLE IF EXISTS `webhooks`;

DROP TABLE IF EXISTS `webhook_logs`;

DROP TABLE IF EXISTS `builders`;

DROP TABLE IF EXISTS `builder_logs`;

17 changes: 17 additions & 0 deletions pkg/dal/migrations/mysql/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,20 @@ CREATE TABLE IF NOT EXISTS `webhook_logs` (
FOREIGN KEY (`webhook_id`) REFERENCES `webhooks` (`id`)
);

CREATE TABLE IF NOT EXISTS `builders` (
`id` bigint AUTO_INCREMENT PRIMARY KEY,
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
`deleted_at` bigint NOT NULL DEFAULT 0
);

CREATE TABLE IF NOT EXISTS `builder_logs` (
`id` bigint AUTO_INCREMENT PRIMARY KEY,
`builder_id` bigint NOT NULL,
`log` LONGBLOB,
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
`deleted_at` bigint NOT NULL DEFAULT 0,
FOREIGN KEY (`builder_id`) REFERENCES `builders` (`id`)
);

14 changes: 12 additions & 2 deletions pkg/dal/migrations/postgresql/0001_initialize.down.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ DROP TABLE IF EXISTS "namespaces";

DROP TABLE IF EXISTS "repositories";

DROP TABLE IF EXISTS "repository_tags";

DROP TABLE IF EXISTS "artifacts";

DROP TABLE IF EXISTS "tags";
Expand All @@ -28,3 +26,15 @@ DROP TABLE IF EXISTS "proxy_tag_tasks";

DROP TABLE IF EXISTS "casbin_rules";

DROP TABLE IF EXISTS "audits";

DROP TABLE IF EXISTS "daemon_logs";

DROP TABLE IF EXISTS "webhooks";

DROP TABLE IF EXISTS "webhook_logs";

DROP TABLE IF EXISTS "builders";

DROP TABLE IF EXISTS "builder_logs";

17 changes: 17 additions & 0 deletions pkg/dal/migrations/postgresql/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -317,3 +317,20 @@ CREATE TABLE IF NOT EXISTS "webhook_logs" (
FOREIGN KEY ("webhook_id") REFERENCES "webhooks" ("id")
);

CREATE TABLE IF NOT EXISTS "builders" (
"id" bigserial PRIMARY KEY,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
"deleted_at" bigint NOT NULL DEFAULT 0
);

CREATE TABLE IF NOT EXISTS "builder_logs" (
"id" bigserial PRIMARY KEY,
"builder_id" bigint NOT NULL,
"log" bytea,
"created_at" timestamp NOT NULL,
"updated_at" timestamp NOT NULL,
"deleted_at" bigint NOT NULL DEFAULT 0,
FOREIGN KEY ("builder_id") REFERENCES "builders" ("id")
);

14 changes: 12 additions & 2 deletions pkg/dal/migrations/sqlite3/0001_initialize.down.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ DROP TABLE IF EXISTS `namespaces`;

DROP TABLE IF EXISTS `repositories`;

DROP TABLE IF EXISTS `repository_tags`;

DROP TABLE IF EXISTS `artifacts`;

DROP TABLE IF EXISTS `tags`;
Expand All @@ -28,3 +26,15 @@ DROP TABLE IF EXISTS `proxy_tag_tasks`;

DROP TABLE IF EXISTS `casbin_rules`;

DROP TABLE IF EXISTS `audits`;

DROP TABLE IF EXISTS `daemon_logs`;

DROP TABLE IF EXISTS `webhooks`;

DROP TABLE IF EXISTS `webhook_logs`;

DROP TABLE IF EXISTS `builders`;

DROP TABLE IF EXISTS `builder_logs`;

17 changes: 17 additions & 0 deletions pkg/dal/migrations/sqlite3/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,20 @@ CREATE TABLE IF NOT EXISTS `webhook_logs` (
FOREIGN KEY (`webhook_id`) REFERENCES `webhooks` (`id`)
);

CREATE TABLE IF NOT EXISTS `builders` (
`id` integer PRIMARY KEY AUTOINCREMENT,
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
`deleted_at` bigint NOT NULL DEFAULT 0
);

CREATE TABLE IF NOT EXISTS `builder_logs` (
`id` integer PRIMARY KEY AUTOINCREMENT,
`builder_id` bigint NOT NULL,
`log` BLOB,
`created_at` timestamp NOT NULL,
`updated_at` timestamp NOT NULL,
`deleted_at` bigint NOT NULL DEFAULT 0,
FOREIGN KEY (`builder_id`) REFERENCES `builders` (`id`)
);

42 changes: 42 additions & 0 deletions pkg/types/builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2023 sigma
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package types

import "github.com/go-sigma/sigma/pkg/types/enums"

// Builder config for builder
type Builder struct {
ScmCredentialType enums.ScmCredentialType `env:"SCM_CREDENTIAL_TYPE,notEmpty"`
ScmSshKey string `env:"SCM_SSH_KEY"`
ScmToken string `env:"SCM_TOKEN"`
ScmUsername string `env:"SCM_USERNAME"`
ScmPassword string `env:"SCM_PASSWORD"`
ScmProvider enums.ScmProvider `env:"SCM_PROVIDER,notEmpty"`
ScmRepository string `env:"SCM_REPOSITORY,notEmpty"`
ScmBranch string `env:"SCM_BRANCH" envDefault:"main"`
ScmDepth int `env:"SCM_DEPTH" envDefault:"0"`
ScmSubModule bool `env:"SCM_SUBMODULE" envDefault:"false"`

OciRegistryDomain string `env:"OCI_REGISTRY_DOMAIN,notEmpty"`
OciRegistryUsername string `env:"OCI_REGISTRY_USERNAME"`
OciRegistryPassword string `env:"OCI_REGISTRY_PASSWORD"`
OciName string `env:"OCI_NAME,notEmpty"`

BuildkitInsecureRegistries []string `env:"BUILDKIT_INSECURE_REGISTRIES" envSeparator:","`
BuildkitCacheDir string `env:"BUILDKIT_CACHE_DIR" envDefault:"/tmp/buildkit"`
BuildkitContext string `env:"BUILDKIT_CONTEXT" envDefault:"."`
BuildkitDockerfile string `env:"BUILDKIT_DOCKERFILE" envDefault:"Dockerfile"`
BuildkitPlatforms []enums.OciPlatform `env:"BUILDKIT_PLATFORMS" envSeparator:","`
}

0 comments on commit a1d0fc7

Please sign in to comment.