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

score-compose init|generate #119

Merged
merged 10 commits into from
Apr 19, 2024
Merged

Conversation

mathieu-benoit
Copy link
Owner

No description provided.

Copy link

Deployment failed for PR-119! ❌

Errors:

error provisioning resource dns#modules.my-sample-workload.externals.dns GuResID: 10ea245ffd9c2f5850a6c8f30fdb61856ec2950b. Status: False. Reason: ResourceProvisionError. Message: resolving resource input secrets: getting remote secret orgs/humanitec/resources/dynamic/default-humanitec-dns/account: secret not found
Errors details

Errors details:

[
  {
    "apiVersion": "entity.humanitec.io/v1b1",
    "entity": {},
    "kind": "DeploymentError",
    "metadata": {
      "app_id": "my-sample-app",
      "deploy_id": "17c786dd6c0ef9d4",
      "env_id": "pr-119",
      "org_id": "mabenoit"
    },
    "status": {
      "code": "OPR-001",
      "error_type": "",
      "message": "error provisioning resource dns#modules.my-sample-workload.externals.dns GuResID: 10ea245ffd9c2f5850a6c8f30fdb61856ec2950b. Status: False. Reason: ResourceProvisionError. Message: resolving resource input secrets: getting remote secret orgs/humanitec/resources/dynamic/default-humanitec-dns/account: secret not found",
      "object_id": "",
      "scope": "environment",
      "summary": "Humanitec Operator error"
    }
  },
  {
    "apiVersion": "entity.humanitec.io/v1b1",
    "entity": {},
    "kind": "DeploymentError",
    "metadata": {
      "app_id": "my-sample-app",
      "deploy_id": "17c786dd6c0ef9d4",
      "env_id": "pr-119",
      "org_id": "mabenoit"
    },
    "status": {
      "code": "OPR-001",
      "error_type": "",
      "message": "error provisioning resource base-env#base-env GuResID: 0e0944be7150b17b44edd91711a9672ae14456f9. Status: False. Reason: DriverFailed. Message: unexpected response code (500) and error provisioning the resource: HTTP-500: Failed to fetch the resource status",
      "object_id": "",
      "scope": "environment",
      "summary": "Humanitec Operator error"
    }
  }
]

View in Humanitec

Deployment ID: 17c786dd6c0ef9d4

Domains:

Deployment diff

Deployment diff:

{
  "modules": {
    "add": {
      "my-sample-workload": {
        "externals": {
          "dns": {
            "class": "default",
            "type": "dns"
          },
          "route": {
            "class": "default",
            "params": {
              "host": "${externals.dns.host}",
              "path": "/",
              "port": 8080
            },
            "type": "route"
          }
        },
        "profile": "humanitec/default-module",
        "spec": {
          "annotations": {
            "humanitec.io/managed-by": "Score",
            "humanitec.io/workload-artefact-name": "my-sample-app/my-sample-workload",
            "humanitec.io/workload-source": "https://github.com/mathieu-benoit/sail-sharp/blob/score-compose-init-generate/score/score.yaml"
          },
          "containers": {
            "my-sample-container": {
              "env": [
                {
                  "name": "POD_NAME",
                  "value": "${pod.metadata.name}"
                },
                {
                  "name": "NAMESPACE_NAME",
                  "value": "${pod.metadata.namespace}"
                }
              ],
              "id": "my-sample-container",
              "image": "us-east4-docker.pkg.dev/mathieu-benoit-gcp/containers/my-sample-app@sha256:406d04f7f94e11ce1b03dc6d273e90334c25d3a55a5ff2981b4edf9f3bd41ed0",
              "resources": {
                "limits": {
                  "cpu": "250m",
                  "memory": "256Mi"
                },
                "requests": {
                  "cpu": "25m",
                  "memory": "64Mi"
                }
              },
              "variables": {
                "MESSAGE": "Hello, World!"
              }
            }
          },
          "service": {
            "ports": {
              "tcp": {
                "container_port": 8080,
                "protocol": "TCP",
                "service_port": 8080
              }
            }
          }
        }
      }
    },
    "remove": [],
    "update": null
  },
  "shared": null
}

@mathieu-benoit mathieu-benoit merged commit f1eadf7 into main Apr 19, 2024
1 of 2 checks passed
@mathieu-benoit mathieu-benoit deleted the score-compose-init-generate branch April 19, 2024 03:30
@@ -0,0 +1,5 @@
.score-compose/99-default.provisioners.yaml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much better to ignore the entire directory right?

.score-compose/

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@@ -0,0 +1,42 @@
score-compose:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I can make a suggestion, a more canonical makefile would look like:

compose.yaml: score/score.yaml
	score-compose init --no-sample
	score-compose generate score/score.yaml \
		--build my-sample-container=app/ \
		--override-property containers.my-sample-container.variables.MESSAGE="Hello, Compose!"

.PHONY: compose-up
compose-up: compose.yaml
	docker compose up --build -d --remove-orphans

.PHONY: compose-test
compose-test: compose-up
	curl localhost:8080

.PHONY: compose-down
compose-down:
	docker compose down -v --remove-orphans || true

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool!


score-helm:
score-helm run \
-f score.yaml \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this score file is somewhere else right?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, fixed in other PR, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants