Skip to content

Commit

Permalink
Merge branch 'feat/release-candidate' into feat/pipeline-target-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
robot9706 committed Dec 4, 2024
2 parents 04f27d3 + 3d3afac commit e0bba87
Show file tree
Hide file tree
Showing 43 changed files with 630 additions and 738 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflows:
- 'product_builder'
branches:
- 'develop'
- 'feat/release-candidate'
types:
- completed
permissions:
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/product_builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ jobs:
crux: ${{ steps.filter.outputs.crux }}
cruxui: ${{ steps.filter.outputs.cruxui }}
kratos: ${{ steps.filter.outputs.kratos }}
tag: ${{ steps.settag.outputs.tag }}
tag: "0.15.0-rc" # ${{ steps.settag.outputs.tag }}
extratag: ${{ steps.settag.outputs.extratag }}
version: ${{ steps.settag.outputs.version }}
version: "0.15.0-rc" # ${{ steps.settag.outputs.version }}
minorversion: ${{ steps.settag.outputs.minorversion }}
release: ${{ steps.release.outputs.release }}
steps:
Expand Down Expand Up @@ -669,11 +669,10 @@ jobs:
defaults:
run:
working-directory: ${{ env.GOLANG_WORKING_DIRECTORY }}
needs: [gather_changes, e2e]
needs: [gather_changes, go_build]
if: |
always() &&
(github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_type == 'tag') &&
needs.e2e.result == 'success' &&
needs.go_build.result == 'success' &&
(needs.crux_build.result == 'success' || needs.crux_build.result == 'skipped') &&
(needs.crux-ui_build.result == 'success' || needs.crux-ui_build.result == 'skipped') &&
Expand Down Expand Up @@ -735,16 +734,16 @@ jobs:
container:
image: ghcr.io/dyrector-io/dyrectorio/builder-images/signer:2
needs: [gather_changes, go_push]
if: |
always() &&
(github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_type == 'tag') &&
needs.e2e.result == 'success' &&
needs.go_build.result == 'success' &&
(needs.crux_build.result == 'success' || needs.crux_build.result == 'skipped') &&
(needs.crux-ui_build.result == 'success' || needs.crux-ui_build.result == 'skipped') &&
(needs.kratos_build.result == 'success' || needs.kratos_build.result == 'skipped') &&
needs.conventional_commits.result == 'success' &&
needs.gather_changes.result == 'success' && needs.go_push.result == 'success'
# if: |
# always() &&
# (github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_type == 'tag') &&
# needs.e2e.result == 'success' &&
# needs.go_build.result == 'success' &&
# (needs.crux_build.result == 'success' || needs.crux_build.result == 'skipped') &&
# (needs.crux-ui_build.result == 'success' || needs.crux-ui_build.result == 'skipped') &&
# (needs.kratos_build.result == 'success' || needs.kratos_build.result == 'skipped') &&
# needs.conventional_commits.result == 'success' &&
# needs.gather_changes.result == 'success' && needs.go_push.result == 'success'
environment: Workflow - Protected
steps:
- name: Login to GHCR
Expand Down Expand Up @@ -800,11 +799,10 @@ jobs:
runs-on: ubuntu-22.04
container:
image: ghcr.io/dyrector-io/dyrectorio/builder-images/signer:2
needs: [crux_build, e2e, gather_changes]
needs: [crux_build, gather_changes]
if: |
always() &&
(github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_type == 'tag') &&
needs.e2e.result == 'success' &&
(needs.go_build.result == 'success' || needs.go_build.result == 'skipped') &&
needs.crux_build.result == 'success' &&
(needs.crux-ui_build.result == 'success' || needs.crux-ui_build.result == 'skipped') &&
Expand Down Expand Up @@ -863,11 +861,10 @@ jobs:
runs-on: ubuntu-22.04
container:
image: ghcr.io/dyrector-io/dyrectorio/builder-images/signer:2
needs: [crux-ui_build, e2e, gather_changes]
needs: [crux-ui_build, gather_changes]
if: |
always() &&
(github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_type == 'tag') &&
needs.e2e.result == 'success' &&
(needs.go_build.result == 'success' || needs.go_build.result == 'skipped') &&
(needs.crux_build.result == 'success' || needs.crux_build.result == 'skipped') &&
needs.crux-ui_build.result == 'success' &&
Expand Down Expand Up @@ -926,11 +923,10 @@ jobs:
runs-on: ubuntu-22.04
container:
image: ghcr.io/dyrector-io/dyrectorio/builder-images/signer:2
needs: [kratos_build, e2e, gather_changes]
needs: [kratos_build, gather_changes]
if: |
always() &&
(github.ref_name == 'develop' || github.ref_name == 'main' || github.ref_type == 'tag') &&
needs.e2e.result == 'success' &&
(needs.go_build.result == 'success' || needs.go_build.result == 'skipped') &&
(needs.crux_build.result == 'success' || needs.crux_build.result == 'skipped') &&
(needs.crux-ui_build.result == 'success' || needs.crux-ui_build.result == 'skipped') &&
Expand Down
37 changes: 11 additions & 26 deletions golang/internal/mapper/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,13 @@ func testExpectedCommon(req *agent.DeployWorkloadRequest) *v1.DeployImageRequest
Password: "test-pass",
},
InstanceConfig: v1.InstanceConfig{
ContainerPreName: "test-prefix",
MountPath: "/path/to/mount",
Name: "test-prefix",
Environment: map[string]string{"Evn1": "Val1", "Env2": "Val2"},
Registry: "",
RepositoryPreName: "repo-prefix",
SharedEnvironment: map[string]string{},
UseSharedEnvs: false,
Environment: map[string]string{},
SharedEnvironment: map[string]string{},
ContainerPreName: "",
},
ContainerConfig: v1.ContainerConfig{
ContainerPreName: "test-prefix",
ContainerPreName: "",
Container: "test-common-config",
Ports: []builder.PortBinding{{ExposedPort: 0x4d2, PortBinding: pointer.ToUint16(0x1a85)}},
PortRanges: []builder.PortRangeBinding{{Internal: builder.PortRange{From: 0x0, To: 0x18}, External: builder.PortRange{From: 0x40, To: 0x80}}},
Expand Down Expand Up @@ -153,7 +149,7 @@ func testExpectedCommon(req *agent.DeployWorkloadRequest) *v1.DeployImageRequest
UseLoadBalancer: true,
ExtraLBAnnotations: map[string]string{"annotation1": "value1"},
},
RuntimeConfig: v1.Base64JSONBytes{0x6b, 0x65, 0x79, 0x31, 0x3d, 0x76, 0x61, 0x6c, 0x31, 0x2c, 0x6b, 0x65, 0x79, 0x32, 0x3d, 0x76, 0x61, 0x6c, 0x32}, // encoded string: a2V5MT12YWwxLGtleTI9dmFsMg==
RuntimeConfig: nil,
Registry: req.Registry,
ImageName: "test-image",
Tag: "test-tag",
Expand Down Expand Up @@ -212,22 +208,17 @@ func TestMapDockerContainerEventToContainerState(t *testing.T) {

func testDeployRequest() *agent.DeployWorkloadRequest {
registry := "https://my-registry.com"
runtimeCfg := "key1=val1,key2=val2"
var uid int64 = 777
upLimit := "5Mi"
mntPath := "/path/to/mount"
repoPrefix := "repo-prefix"
strategy := common.ExposeStrategy_EXPOSE_WITH_TLS
b := true
return &agent.DeployWorkloadRequest{
Id: "testID",
ContainerName: "test-container",
ImageName: "test-image",
Tag: "test-tag",
Registry: &registry,
RuntimeConfig: &runtimeCfg,
Dagent: testDagentConfig(),
Crane: testCraneConfig(),
Id: "testID",
ImageName: "test-image",
Tag: "test-tag",
Registry: &registry,
Dagent: testDagentConfig(),
Crane: testCraneConfig(),
Common: &agent.CommonContainerConfig{
Name: "test-common-config",
Commands: []string{"make", "test"},
Expand Down Expand Up @@ -274,12 +265,6 @@ func testDeployRequest() *agent.DeployWorkloadRequest {
Password: "test-pass",
Url: "https://test-url.com",
},
InstanceConfig: &agent.InstanceConfig{
Prefix: "test-prefix",
MountPath: &mntPath,
RepositoryPrefix: &repoPrefix,
Environment: map[string]string{"Evn1": "Val1", "Env2": "Val2"},
},
}
}

Expand Down
5 changes: 5 additions & 0 deletions golang/pkg/dagent/utils/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ func getContainerPrefix(deployImageRequest *v1.DeployImageRequest) string {
containerPrefix = deployImageRequest.InstanceConfig.ContainerPreName
}
}

if containerPrefix == "" {
containerPrefix = deployImageRequest.ContainerConfig.ContainerPreName
}

return containerPrefix
}

Expand Down
Loading

0 comments on commit e0bba87

Please sign in to comment.