Skip to content

Commit

Permalink
✨ Change time field type to int64 (#332)
Browse files Browse the repository at this point in the history
* 🐛 Fix user login token

* ✨ Change time field type to int64
  • Loading branch information
tosone authored Mar 10, 2024
1 parent ef12a26 commit d05dbef
Show file tree
Hide file tree
Showing 78 changed files with 411 additions and 406 deletions.
13 changes: 4 additions & 9 deletions conf/config-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,9 @@ proxy:

# daemon task config
daemon:
gc:
# if blob not associate with artifact
retention: 72h
# At 02:00 on Saturday
cron: 0 2 * * 6
builder:
enabled: false
image: ghcr.io/go-sigma/sigma-builder:latest
enabled: true
image: docker.io/tosone/sigma-builder:latest
type: docker
docker:
sock:
Expand All @@ -142,8 +137,8 @@ auth:
realm: ""
service: ""
jwt:
ttl: 1h
refreshTtl: 24h
ttl: 6h
refreshTtl: 72h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTFBQRklQcndKdEVoZ0JyVmV4MlY1UVRZCkVETnBHWkhwbUxrekpqbTJCOEd6blJEdDNaOGNlRnFFU3RxdU9CdUQ5VlYyYisvZS9ZSzcrVlF6aFpuQUhNZGgKbk5UUklxRFJqckF1UmhDN3U5MmR1b0w0S2s0a0JZNTRBa2JxQnRJZytZUXd1ODBnbDJrTjR0L3hqcWFveXl1VApDSGV3OXlwa3BONFFQTGZ1TU1OYjhYUktSdFV2cGlVekZkRmpGTkQ4eS9haVBkVlRYdVRNbGhUNjcvOXphbXlRCmtUU1V5c1l3aUtLSlRxb0N5SkFMTXRtekNrVHNTY0cxeURhcjh2cldWWDdtMnpVR0pRaW5QTllpV1JSS3IySWMKbUVTRXM3ZkROWm8zbnNka05sWEZNUWorZWVVa25Ebmk1VmtENFV1aVpBTmNXTHE4ckpBV0hTTEFtcUltK1BGUgpJVmZvcDZ0d3M5dXl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CmRpdXM0bUhXQnNvSFZjNkdBdUxVVlUvRis1SzZhTktLRFFLQ0FRRUF2VHRzZmNlVFE1cjRTTFlUMTlnMU5GMVgKckFPaUhzVHQ5TFNZUXNZUmpEcGZqR0t1b29jN091Q1ZGdGYwa1ArUkliODJIK05QRVNPMXlpclNzMTVaWnFobAorTXpmY1YrL1dHOVovZlAyUG5ZYVFCeWFOWkNMK3dSTW5nbXJycnF1RjZSRXk1UHQ5Z2pkaU1heXhSSzlVODVKCkY4WFVqcmhuVTJYMUxHTFAzaEoxV0lUbTh6V2RlcytyZU1JR2RNL3grajRBbW80R3FuMzd1U05WRkR4QVhuV2gKRzhPejBaa0dXb25Xai9CRVhnR2RiVk5uVldLQWpodUlRbkZwbHR4R3VpNzhyS09lSEhHVElEUDNZK1h5ZW9ZbAoxVTNtYWVrUGxEaURlUlBmemhjRFBJc0h2b3VoUVZCSlAxRTh2d1VpZkJ1bTEzSDZ5SjdKajcrR29Rb2diZz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
Expand Down
9 changes: 2 additions & 7 deletions conf/config-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ proxy:

# daemon task config
daemon:
gc:
# if blob not associate with artifact
retention: 72h
# At 02:00 on Saturday
cron: 0 2 * * 6
builder:
enabled: false
image: ghcr.io/go-sigma/sigma-builder:nightly
Expand All @@ -145,8 +140,8 @@ auth:
realm: ""
service: ""
jwt:
ttl: 1h
refreshTtl: 24h
ttl: 6h
refreshTtl: 72h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTFBQRklQcndKdEVoZ0JyVmV4MlY1UVRZCkVETnBHWkhwbUxrekpqbTJCOEd6blJEdDNaOGNlRnFFU3RxdU9CdUQ5VlYyYisvZS9ZSzcrV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0bHRwcGJBS0xLWW9MYmV6MwpSQ0UwdmtpTlI5L01wSlV2MFAxUmhiZVBMc2htQ3piemN5bkVJK1dBZUF3enpXc0N6M3l6Ly9DK3Q3MWhDa0tQCll6OVBtVExNM2kwTHBEVkFxazZSVG5TaFZGbGZBYjN5TWlVWS9wcXpwTlU4VlI4N2gzSW5Ma2hOck5DL01jbkIKdTE1aytvTFAyY0JNWGxBS0pwZUdlRFhTVjFrcG5PeEtvVmJiS1ZZc0JMYUdwQ3ZNekp6djNibkQ3ZVZKblJCdgoxT3BZa0E0bVJqYVI2R1VRYjA4UlJMckZzZDQxMTg5UzRXM21WVm9uU3JGb2tpSnB5elpFbTY5RnRqSmZKMkt0CmRpdXM0bUhXQnNvSFZjNkdBdUxVVlUvRis1SzZhTktLRFFLQ0FRRUF2VHRzZmNlVFE1cjRTTFlUMTlnMU5GMVgKckFPaUhzVHQ5TFNZUXNZUmpEcGZqR0t1b29jN091Q1ZGdGYwa1ArUkliODJIK05QRVNPMXlpclNzMTVaWnFobAorTXpmY1YrL1dHOVovZlAyUG5ZYVFCeWFOWkNMK3dSTW5nbXJycnF1RjZSRXk1UHQ5Z2pkaU1heXhSSzlVODVKCkY4WFVqcmhuVTJYMUxHTFAzaEoxV0lUbTh6V2RlcytyZU1JR2RNL3grajRBbW80R3FuMzd1U05WRkR4QVhuV2gKRzhPejBaa0dXb25Xai9CRVhnR2RiVk5uVldLQWpodUlRbkZwbHR4R3VpNzhyS09lSEhHVElEUDNZK1h5ZW9ZbAoxVTNtYWVrUGxEaURlUlBmemhjRFBJc0h2b3VoUVZCSlAxRTh2d1VpZkJ1bTEzSDZ5SjdKajcrR29Rb2diZz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
Expand Down
9 changes: 2 additions & 7 deletions conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ proxy:

# daemon task config
daemon:
gc:
# if blob not associate with artifact
retention: 72h
# At 02:00 on Saturday
cron: 0 2 * * 6
builder:
enabled: false
image: sigma-builder:latest
Expand All @@ -146,8 +141,8 @@ auth:
realm: ""
service: ""
jwt:
ttl: 1h
refreshTtl: 24h
ttl: 6h
refreshTtl: 72h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBcHNISUFnRUpZSnFRcWRyZDNBWlhiVmROTFBQRklQcndKdEVoZ0JyVmV4MlY1UVRZCkVETnBHWkhwbUxrekpqbTJCOEd6blJEdDNaOGNlRnFFU3RxdU9CdUQ5VlYyYisvZS9ZSzcrVlF6aFpuQUhNZGgKbk5UUklxRFJqckF1UmhDN3U5MmR1b0w0S2s0a0JZNTRBa2JxQnRJZytZUXd1ODBnbDJrTjR0L3hqcWFveXl1VApDSGV3OXlwa3BONFFQTGZ1TU1OYjhYUktSdFV2cGlVekZkRmpGTkQ4eS9haVBkVlRYdVRNbGhUNjcvOXphbXlRCmtUU1V5c1l3aUtLSlRxb0N5SkFMTXRtekNrVHNTY0cxeURhcjh2cldWWDdtMnpVR0pRaW5QTllpV1JSS3IySWMKbUVTRXM3ZkROWm8zbnNka05sWEZNUWorZWVVa25Ebmk1VmtENFV1aVpBTmNXTHE4ckpBV0hTTEFtcUltK1BGUgpJVmZvcDZ0d3M5dXlUNWR2d0s2cldJcE9RRG5iZWhSM2FmU2ljY2YzQXVGNldLTFVJd05hanBhaThPdWZmYkFkClpSVTBBa2pFb2h5a1JxZnBqTEFGelBtaXdlYmo3OVdZaktlbXhIaVMxTlNEZFhnVHFRd2d0emFtQmlSbTkwYncKNk54VVRadU5hN1NQVnhvYWNZTHdSWnY4RUR0VFZyVEtMbEhZMEVCS0xPWGpLUEdUWXV0S2RDK3ZHWXhwTC9vVwoxVm5qWXpkYlhsR1VGQkRaczh5K2FsMEFRYVNDejVNUXVaYjdYVW9oTWRYRm1YT2FETnEyK3hsMU9DdFkrWlp1CnF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1U05WRkR4QVhuV2gKRzhPejBaa0dXb25Xai9CRVhnR2RiVk5uVldLQWpodUlRbkZwbHR4R3VpNzhyS09lSEhHVElEUDNZK1h5ZW9ZbAoxVTNtYWVrUGxEaURlUlBmemhjRFBJc0h2b3VoUVZCSlAxRTh2d1VpZkJ1bTEzSDZ5SjdKajcrR29Rb2diZz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="
oauth2:
Expand Down
7 changes: 1 addition & 6 deletions docs/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ proxy:

# daemon task config
daemon:
gc:
# if blob not associate with artifact
retention: 72h
# At 02:00 on Saturday
cron: 0 2 * * 6
builder:
image: sigma-builder:latest
type: docker
Expand All @@ -142,7 +137,7 @@ auth:
service: ""
jwt:
ttl: 1h
refreshTtl: 24h
refreshTtl: 72h
# generate the key with: openssl genrsa 4096 | base64
privateKey: "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSB"
oauth2:
Expand Down
3 changes: 2 additions & 1 deletion e2e/multiarch/push.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/bash

# docker buildx create --use --config ./buildkit.toml

docker buildx build --sbom=true --platform linux/amd64,linux/arm64 --tag 192.168.31.198:3000/library/alpine:3.18.0 --file alpine.Dockerfile --push .
Expand Down
1 change: 0 additions & 1 deletion pkg/configs/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ type ConfigurationDaemonBuilder struct {

// ConfigurationDaemon ...
type ConfigurationDaemon struct {
Gc ConfigurationDaemonGc `yaml:"gc"`
Builder ConfigurationDaemonBuilder `yaml:"builder"`
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/configs/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ func defaultSettings() {
if configuration.Cache.Ttl == 0 {
configuration.Cache.Ttl = 72 * time.Hour
}
if configuration.Daemon.Gc.Retention == 0 {
configuration.Daemon.Gc.Retention = 72 * time.Hour
}
if configuration.Daemon.Builder.Kubernetes.Namespace == "" {
configuration.Daemon.Builder.Kubernetes.Namespace = "default"
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/coderepo/coderepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func crRunner(ctx context.Context, payload []byte) error {
}
userService := dao.NewUserServiceFactory().New()
err = userService.UpdateUser3rdParty(ctx, task.User3rdPartyID, map[string]any{
query.User3rdParty.CrLastUpdateTimestamp.ColumnName().String(): time.Now(),
query.User3rdParty.CrLastUpdateTimestamp.ColumnName().String(): time.Now().UnixMilli(),
query.User3rdParty.CrLastUpdateStatus.ColumnName().String(): status,
query.User3rdParty.CrLastUpdateMessage.ColumnName().String(): statusMessage,
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/daemon/gc/decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ func decorator(daemon enums.Daemon, injects ...inject) func(context.Context, []b
}
if status.Started {
startedAt = time.Now()
updates["started_at"] = startedAt
updates["started_at"] = startedAt.UnixMilli()
}
if status.Ended {
endedAt := time.Now()
updates["ended_at"] = endedAt
updates["ended_at"] = endedAt.UnixMilli()
updates["duration"] = endedAt.Sub(startedAt).Milliseconds()
}
if len(status.Updates) != 0 {
Expand Down
9 changes: 7 additions & 2 deletions pkg/daemon/gc/gc_artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ func (g gcArtifact) deleteArtifactWithNamespace() {
defer close(g.deleteArtifactCheckChan)
for task := range g.deleteArtifactWithNamespaceChan {
var repositoryCurIndex int64
timeTarget := time.Now().Add(-1 * g.config.Daemon.Gc.Retention)
timeTarget := time.Now().UnixMilli()
if g.runnerObj.Rule.RetentionDay > 0 {
timeTarget = time.Now().Add(-1 * time.Duration(g.runnerObj.Rule.RetentionDay) * 24 * time.Hour).UnixMilli()
}
for {
repositoryObjs, err := repositoryService.FindAll(g.ctx, task.NamespaceID, pagination, repositoryCurIndex)
if err != nil {
Expand Down Expand Up @@ -249,6 +252,8 @@ func (g gcArtifact) deleteArtifact() {
defer g.waitAllDone.Done()
defer close(g.collectRecordChan)
for task := range g.deleteArtifactChan {
// TODO: we should set a lock for the delete action
// otherwise, we should delete the artifact in goroutine
err := query.Q.Transaction(func(tx *query.Query) error {
err := g.artifactServiceFactory.New(tx).DeleteByID(g.ctx, task.Artifact.ID)
if err != nil {
Expand Down Expand Up @@ -319,7 +324,7 @@ func (g gcArtifact) packWebhookObj(action enums.WebhookAction) types.WebhookPayl
Username: g.runnerObj.OperateUser.Username,
Email: ptr.To(g.runnerObj.OperateUser.Email),
Status: g.runnerObj.OperateUser.Status,
LastLogin: g.runnerObj.OperateUser.LastLogin.Format(consts.DefaultTimePattern),
LastLogin: time.Unix(0, int64(time.Millisecond)*g.runnerObj.OperateUser.LastLogin).UTC().Format(consts.DefaultTimePattern),
CreatedAt: time.Unix(0, int64(time.Millisecond)*g.runnerObj.OperateUser.CreatedAt).UTC().Format(consts.DefaultTimePattern),
UpdatedAt: time.Unix(0, int64(time.Millisecond)*g.runnerObj.OperateUser.CreatedAt).UTC().Format(consts.DefaultTimePattern),
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/daemon/gc/gc_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ func (g gcBlob) Run(runnerID int64) error {

blobService := g.blobServiceFactory.New()

timeTarget := time.Now()
timeTarget := time.Now().UnixMilli()
if g.runnerObj.Rule.RetentionDay > 0 {
timeTarget = time.Now().Add(-1 * time.Duration(g.runnerObj.Rule.RetentionDay) * 24 * time.Hour)
timeTarget = time.Now().Add(-1 * time.Duration(g.runnerObj.Rule.RetentionDay) * 24 * time.Hour).UnixMilli()
}

g.deleteBlobChanOnce.Do(g.deleteBlob)
Expand Down Expand Up @@ -185,6 +185,7 @@ func (g gcBlob) deleteBlob() {
defer g.waitAllDone.Done()
defer close(g.collectRecordChan)
for task := range g.deleteBlobChan {
// TODO: we should set a lock for the delete action
err := blobService.DeleteByID(g.ctx, task.Blob.ID)
if err != nil {
log.Error().Err(err).Interface("Task", task).Msgf("Delete blob failed: %v", err)
Expand Down Expand Up @@ -255,7 +256,7 @@ func (g gcBlob) packWebhookObj(action enums.WebhookAction) types.WebhookPayloadG
Username: g.runnerObj.OperateUser.Username,
Email: ptr.To(g.runnerObj.OperateUser.Email),
Status: g.runnerObj.OperateUser.Status,
LastLogin: g.runnerObj.OperateUser.LastLogin.Format(consts.DefaultTimePattern),
LastLogin: time.Unix(0, int64(time.Millisecond)*g.runnerObj.OperateUser.LastLogin).UTC().Format(consts.DefaultTimePattern),
CreatedAt: time.Unix(0, int64(time.Millisecond)*g.runnerObj.OperateUser.CreatedAt).UTC().Format(consts.DefaultTimePattern),
UpdatedAt: time.Unix(0, int64(time.Millisecond)*g.runnerObj.OperateUser.CreatedAt).UTC().Format(consts.DefaultTimePattern),
}
Expand Down
Loading

0 comments on commit d05dbef

Please sign in to comment.