Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: extend ARM platform changes through to deployment #2814

Merged
merged 16 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion internal/pkg/cli/job_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ func (o *initJobOpts) Execute() error {
return err
}
o.platform = platform
if o.platform != nil {
log.Warningf("Your architecture type is currently unsupported. Setting platform %s instead.\nSee 'platform' field in your manifest.\n", dockerengine.DockerBuildPlatform(dockerengine.LinuxOS, dockerengine.Amd64Arch))
huanjani marked this conversation as resolved.
Show resolved Hide resolved
}

manifestPath, err := o.init.Job(&initialize.JobProps{
WorkloadProps: initialize.WorkloadProps{
Expand All @@ -202,7 +205,9 @@ func (o *initJobOpts) Execute() error {
Type: o.wkldType,
DockerfilePath: o.dockerfilePath,
Image: o.image,
Platform: o.platform,
Platform: manifest.PlatformArgsOrString{
PlatformString: o.platform,
},
},

Schedule: o.schedule,
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/cli/job_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ func TestJobInitOpts_Execute(t *testing.T) {
Name: "mailer",
Type: "Scheduled Job",
DockerfilePath: "./Dockerfile",
Platform: nil,
Platform: manifest.PlatformArgsOrString{},
},
Schedule: "@hourly",
HealthCheck: manifest.ContainerHealthCheck{
Expand Down
8 changes: 5 additions & 3 deletions internal/pkg/cli/svc_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (o *initSvcOpts) Execute() error {
}
o.platform = platform
if o.platform != nil {
log.Warningf(`Your architecture type is currently unsupported. Setting platform %s instead.\n`, dockerengine.DockerBuildPlatform(dockerengine.LinuxOS, dockerengine.Amd64Arch))
log.Warningf("Your architecture type is currently unsupported. Setting platform %s instead.\n", dockerengine.DockerBuildPlatform(dockerengine.LinuxOS, dockerengine.Amd64Arch))
if o.wkldType != manifest.RequestDrivenWebServiceType {
log.Warning("See 'platform' field in your manifest.\n")
}
Expand All @@ -273,8 +273,10 @@ func (o *initSvcOpts) Execute() error {
Type: o.wkldType,
DockerfilePath: o.dockerfilePath,
Image: o.image,
Platform: o.platform,
Topics: o.topics,
Platform: manifest.PlatformArgsOrString{
PlatformString: o.platform,
},
Topics: o.topics,
},
Port: o.port,
HealthCheck: hc,
Expand Down
10 changes: 5 additions & 5 deletions internal/pkg/cli/svc_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func TestSvcInitOpts_Execute(t *testing.T) {
Name: "frontend",
Type: "Load Balanced Web Service",
DockerfilePath: "./Dockerfile",
Platform: nil,
Platform: manifest.PlatformArgsOrString{},
},
Port: 80,
}).Return("manifest/path", nil)
Expand All @@ -650,7 +650,7 @@ func TestSvcInitOpts_Execute(t *testing.T) {
Name: "frontend",
Type: "Backend Service",
DockerfilePath: "./Dockerfile",
Platform: nil,
Platform: manifest.PlatformArgsOrString{},
},
}).Return("manifest/path", nil)
},
Expand All @@ -676,7 +676,7 @@ func TestSvcInitOpts_Execute(t *testing.T) {
Name: "frontend",
Type: "Worker Service",
DockerfilePath: "./Dockerfile",
Platform: nil,
Platform: manifest.PlatformArgsOrString{},
},
}).Return("manifest/path", nil)
},
Expand Down Expand Up @@ -715,7 +715,7 @@ func TestSvcInitOpts_Execute(t *testing.T) {
Name: "backend",
Type: "Backend Service",
Image: "nginx:latest",
Platform: nil,
Platform: manifest.PlatformArgsOrString{},
},
}).Return("manifest/path", nil)
},
Expand All @@ -740,7 +740,7 @@ func TestSvcInitOpts_Execute(t *testing.T) {
Name: "frontend",
Type: "Load Balanced Web Service",
Image: "nginx:latest",
Platform: nil,
Platform: manifest.PlatformArgsOrString{},
},
}).Return("manifest/path", nil)
},
Expand Down
9 changes: 7 additions & 2 deletions internal/pkg/initialize/workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type WorkloadProps struct {
Name string
DockerfilePath string
Image string
Platform *string
Platform manifest.PlatformArgsOrString
Topics []manifest.TopicSubscription
}

Expand Down Expand Up @@ -271,6 +271,7 @@ func newJobManifest(i *JobProps) (encoding.BinaryMarshaler, error) {
Image: i.Image,
},
HealthCheck: i.HealthCheck,
Platform: i.Platform,
Schedule: i.Schedule,
Timeout: i.Timeout,
Retries: i.Retries,
Expand Down Expand Up @@ -305,6 +306,7 @@ func (w *WorkloadInitializer) newLoadBalancedWebServiceManifest(i *ServiceProps)
},
Port: i.Port,
HealthCheck: i.HealthCheck,
Platform: i.Platform,
Path: "/",
}
existingSvcs, err := w.Store.ListServices(i.App)
Expand All @@ -329,7 +331,8 @@ func (w *WorkloadInitializer) newRequestDrivenWebServiceManifest(i *ServiceProps
Dockerfile: i.DockerfilePath,
Image: i.Image,
},
Port: i.Port,
Port: i.Port,
Platform: i.Platform,
}
return manifest.NewRequestDrivenWebService(props)
}
Expand All @@ -343,6 +346,7 @@ func newBackendServiceManifest(i *ServiceProps) (*manifest.BackendService, error
},
Port: i.Port,
HealthCheck: i.HealthCheck,
Platform: i.Platform,
}), nil
}

Expand All @@ -354,6 +358,7 @@ func newWorkerServiceManifest(i *ServiceProps) (*manifest.WorkerService, error)
Image: i.Image,
},
HealthCheck: i.HealthCheck,
Platform: i.Platform,
Topics: i.Topics,
}), nil
}
Expand Down
Loading