|
|
@@ -47,82 +47,6 @@ func TestParseYAML(t *testing.T) {
|
|
|
|
|
|
var result_nobuild = &porterv1.PorterApp{
|
|
|
Name: "test-app",
|
|
|
- Services: map[string]*porterv1.Service{
|
|
|
- "example-web": {
|
|
|
- Name: "example-web",
|
|
|
- RunOptional: pointer.String("node index.js"),
|
|
|
- Port: 8080,
|
|
|
- CpuCores: 0.1,
|
|
|
- RamMegabytes: 256,
|
|
|
- Gpu: &porterv1.GPU{
|
|
|
- Enabled: false,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- },
|
|
|
- Config: &porterv1.Service_WebConfig{
|
|
|
- WebConfig: &porterv1.WebServiceConfig{
|
|
|
- Autoscaling: &porterv1.Autoscaling{
|
|
|
- Enabled: true,
|
|
|
- MinInstances: 1,
|
|
|
- MaxInstances: 3,
|
|
|
- CpuThresholdPercent: 60,
|
|
|
- MemoryThresholdPercent: 60,
|
|
|
- },
|
|
|
- Domains: []*porterv1.Domain{
|
|
|
- {
|
|
|
- Name: "test1.example.com",
|
|
|
- },
|
|
|
- {
|
|
|
- Name: "test2.example.com",
|
|
|
- },
|
|
|
- },
|
|
|
- HealthCheck: &porterv1.HealthCheck{
|
|
|
- Enabled: true,
|
|
|
- HttpPath: "/healthz",
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
- Type: 1,
|
|
|
- },
|
|
|
- "example-wkr": {
|
|
|
- Name: "example-wkr",
|
|
|
- RunOptional: pointer.String("echo 'work'"),
|
|
|
- InstancesOptional: pointer.Int32(1),
|
|
|
- Port: 80,
|
|
|
- CpuCores: 0.1,
|
|
|
- RamMegabytes: 256,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- Gpu: &porterv1.GPU{
|
|
|
- Enabled: false,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- },
|
|
|
- Config: &porterv1.Service_WorkerConfig{
|
|
|
- WorkerConfig: &porterv1.WorkerServiceConfig{
|
|
|
- Autoscaling: nil,
|
|
|
- },
|
|
|
- },
|
|
|
- Type: 2,
|
|
|
- },
|
|
|
- "example-job": {
|
|
|
- Name: "example-job",
|
|
|
- RunOptional: pointer.String("echo 'hello world'"),
|
|
|
- CpuCores: 0.1,
|
|
|
- RamMegabytes: 256,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- Gpu: &porterv1.GPU{
|
|
|
- Enabled: false,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- },
|
|
|
- Config: &porterv1.Service_JobConfig{
|
|
|
- JobConfig: &porterv1.JobServiceConfig{
|
|
|
- AllowConcurrentOptional: pointer.Bool(true),
|
|
|
- Cron: "*/10 * * * *",
|
|
|
- SuspendCron: pointer.Bool(false),
|
|
|
- TimeoutSeconds: 60,
|
|
|
- },
|
|
|
- },
|
|
|
- Type: 3,
|
|
|
- },
|
|
|
- },
|
|
|
ServiceList: []*porterv1.Service{
|
|
|
{
|
|
|
Name: "example-web",
|
|
|
@@ -227,71 +151,6 @@ var (
|
|
|
|
|
|
var v1_result_nobuild_no_image = &porterv1.PorterApp{
|
|
|
Name: "test-app",
|
|
|
- Services: map[string]*porterv1.Service{
|
|
|
- "example-job": {
|
|
|
- Name: "example-job",
|
|
|
- RunOptional: pointer.String("echo 'hello world'"),
|
|
|
- CpuCores: 0.1,
|
|
|
- RamMegabytes: 256,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- Config: &porterv1.Service_JobConfig{
|
|
|
- JobConfig: &porterv1.JobServiceConfig{
|
|
|
- AllowConcurrentOptional: &trueBool,
|
|
|
- Cron: "*/10 * * * *",
|
|
|
- },
|
|
|
- },
|
|
|
- Type: 3,
|
|
|
- },
|
|
|
- "example-wkr": {
|
|
|
- Name: "example-wkr",
|
|
|
- RunOptional: pointer.String("echo 'work'"),
|
|
|
- InstancesOptional: &oneInt32,
|
|
|
- Port: 80,
|
|
|
- CpuCores: 0.1,
|
|
|
- RamMegabytes: 256,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- Config: &porterv1.Service_WorkerConfig{
|
|
|
- WorkerConfig: &porterv1.WorkerServiceConfig{
|
|
|
- Autoscaling: nil,
|
|
|
- },
|
|
|
- },
|
|
|
- Type: 2,
|
|
|
- },
|
|
|
- "example-web": {
|
|
|
- Name: "example-web",
|
|
|
- RunOptional: pointer.String("node index.js"),
|
|
|
- InstancesOptional: &zeroInt32,
|
|
|
- Port: 8080,
|
|
|
- CpuCores: 0.1,
|
|
|
- GpuCoresNvidia: 0,
|
|
|
- RamMegabytes: 256,
|
|
|
- Config: &porterv1.Service_WebConfig{
|
|
|
- WebConfig: &porterv1.WebServiceConfig{
|
|
|
- Autoscaling: &porterv1.Autoscaling{
|
|
|
- Enabled: true,
|
|
|
- MinInstances: 1,
|
|
|
- MaxInstances: 3,
|
|
|
- CpuThresholdPercent: 60,
|
|
|
- MemoryThresholdPercent: 60,
|
|
|
- },
|
|
|
- Domains: []*porterv1.Domain{
|
|
|
- {
|
|
|
- Name: "test1.example.com",
|
|
|
- },
|
|
|
- {
|
|
|
- Name: "test2.example.com",
|
|
|
- },
|
|
|
- },
|
|
|
- HealthCheck: &porterv1.HealthCheck{
|
|
|
- Enabled: true,
|
|
|
- HttpPath: "/healthz",
|
|
|
- },
|
|
|
- Private: pointer.Bool(false),
|
|
|
- },
|
|
|
- },
|
|
|
- Type: 1,
|
|
|
- },
|
|
|
- },
|
|
|
ServiceList: []*porterv1.Service{
|
|
|
{
|
|
|
Name: "example-web",
|