-
Notifications
You must be signed in to change notification settings - Fork 18
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
pebcak? not working out of the box. #786
Comments
@F0gC10ud The starter example here should work as is: https://docs.compose-x.io/examples/nginx_simple.html And your x-vpc syntax is wrong as well
|
The The compose-cli was I hoped a good replacement for this project but it was lacking some essentials, I found the syntax for overrides was difficult and generally compose-x had gone a lot further already. While it doesn't work like for like to use the two, you should be able to achieve similar results. One tweak I would do from @raffidahmad answer (thanks btw man!) x-vpc:
Lookup:
VpcId:
Tags:
Name: xyz-vpc
AppSubnets:
Tags:
Name: xyz-subnet-private1-${AWS_REGION}a
StorageSubnets:
Tags:
Name: xyz-subnet-private1-${AWS_REGION}a
PublicSubnets:
Tags:
Name: xyz-subnet-public1-${AWS_REGION}a Tags appear in most places as a |
if I can get this to work I will be very excited to use this tool, so thanks. The VPC questionwrt to the vpc stuff, just to be clear, in case I am getting this wrong. Am I getting this right? x-vpc:
Lookup:
VpcId:
Tags:
Name: myapp
AppSubnets:
Tags:
Name: myapp-private1a-ca-central-1a
The pebcak :)Following the suggestion, to try https://docs.compose-x.io/examples/nginx_simple.html Using the docker command to avoid an local env related issues I am getting one of the errors I get when trying some of the compose-x-labs. validators.py", line 451, in validate
raise error
jsonschema.exceptions.ValidationError: [{'name': 'frontend:frontend', 'port': 80, 'protocol': 'HTTP', 'healthcheck': '80:HTTP:/:200'}] is not of type 'object' the files and logsjust to show you that I copied exactly what is on the web site. The logs when using dockerdocker run -u $(id -u):$(id -u) -it --rm -v ~/.aws:/tmp/.aws -e HOME=/tmp -v $PWD:/tmp public.ecr.aws/compose-x/compose-x:latest plan -f docker-compose.yaml -f aws-compose-x.yaml -n frontend-app
2025-01-15 21:05:47 [ INFO] services.frontend - No Launch Type defined. Using default: FARGATE
2025-01-15 21:05:47 [ INFO] Service families to process ['frontend']
2025-01-15 21:05:47 [ INFO] No cluster information provided. Creating a new one
Loaded x-elbv2 elbv2 elbv2 /usr/local/lib/python3.10/site-packages/ecs_composex/elbv2
2025-01-15 21:05:47 [ ERROR] elbv2.public-alb - Definition is not conform to schema.
Traceback (most recent call last):
File "/usr/local/bin/ecs-compose-x", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/ecs_composex/cli.py", line 213, in main
root_stack = generate_full_template(settings)
File "/usr/local/lib/python3.10/site-packages/ecs_composex/ecs_composex.py", line 248, in generate_full_template
settings.mod_manager.init_mods_resources(settings)
File "/usr/local/lib/python3.10/site-packages/ecs_composex/mods_manager.py", line 307, in init_mods_resources
module.set_resources(settings)
File "/usr/local/lib/python3.10/site-packages/ecs_composex/mods_manager.py", line 266, in set_resources
new_definition = self.resource_class(
File "/usr/local/lib/python3.10/site-packages/ecs_composex/elbv2/elbv2_stack/elbv2.py", line 75, in __init__
super().__init__(name, definition, module, settings)
File "/usr/local/lib/python3.10/site-packages/ecs_composex/compose/x_resources/network_x_resources.py", line 37, in __init__
super().__init__(name, definition, module, settings)
File "/usr/local/lib/python3.10/site-packages/ecs_composex/compose/x_resources/services_resources.py", line 39, in __init__
super().__init__(name, definition, module, settings)
File "/usr/local/lib/python3.10/site-packages/ecs_composex/compose/x_resources/__init__.py", line 79, in __init__
self.validate_schema(name, definition, module.mod_key)
File "/usr/local/lib/python3.10/site-packages/ecs_composex/compose/x_resources/__init__.py", line 191, in validate_schema
_eval.validate(definition)
File "/usr/local/lib/python3.10/site-packages/jsonschema/validators.py", line 451, in validate
raise error
jsonschema.exceptions.ValidationError: [{'name': 'frontend:frontend', 'port': 80, 'protocol': 'HTTP', 'healthcheck': '80:HTTP:/:200'}] is not of type 'object'
Failed validating 'type' in schema['properties']['Services']:
{'type': 'object',
'additionalProperties': False,
'patternProperties': {'x-': {},
'^[a-zA-Z0-9\\:_\\-]+$': {'$ref': '#/definitions/TargetDef'}}}
On instance['Services']:
[{'name': 'frontend:frontend',
'port': 80,
'protocol': 'HTTP',
'healthcheck': '80:HTTP:/:200'}] aws-compose-x.yaml click to viewservices:
frontend:
x-ecr:
InterpolateWithDigest: true
# We need DNS information. We indicate which DNS zone to use publicly and which one to use in the VPC.
# Given that we do not indicate Lookup, the new DNS Zones will be created.
x-dns:
PublicZone:
Name: mydomain.net # Create a new public route53 zone.
PrivateNamespace:
Name: cluster.internal # Create a new AWS CloudMap service discovery instance associated with the VPC
# We create an ALB and send traffic to our frontend. Note that the listener is not encrypted at this point.
# To use encryption we need n ACM certificate and set the listener protocol to HTTPS
x-elbv2:
public-alb:
Properties:
Scheme: internet-facing
Type: application
Services:
- name: frontend:frontend
port: 80
protocol: HTTP
healthcheck: 80:HTTP:/:200 # We expect port 80 with HTTP protocol to work and we expect a 200 OK return
Listeners:
- Port: 80
Protocol: HTTP
Targets:
- name: frontend:frontend
access: / docker-compose.yaml click to viewversion: "3.8"
volumes:
app:
services:
frontend:
image: ${REGISTRY_URI}frontend:${TAG:-latest}
ports:
- protocol: tcp
target: 80
build:
context: .
dockerfile: Dockerfile
deploy:
resources:
limits:
cpus: 0.5
memory: 256MB
reservations:
cpus: 0.1
memory: 128MB |
I need to update a bunch of example files as it stands. Check for more up to date examples in the labs. |
I will update the docs to reflect the correct syntax. But generally, check the |
Hello,
I just found your project and I am grateful for the work you are doing! I was previously a user of https://github.com/docker-archive/compose-cli and was sad when it started to die.
Keep up the great work!
The bug[s]?
I am assuming I am doing something wrong, but I have tried on my linux desktop in a docker container, on both
master
and tagv1.1.6
. I still get errors with most of the things I try do. (I still haven't managed to deploy anything yet. )Reproducing issue
out of the box e2e-examples/nginx_webapp
Out of the box using tag v1.1.6, I get this error
Error
See full log further below
Work envs
Logs
Hold my beer, full log
PEBKAC, ou une case 18"?
If its just me here are other details
fwiw
ca-centra-1
, and I noticed it was absent from the source I grep'd throughx-vpc
, for the most, it will never work, regardless of what typeWhen trying to build a config from scratch or using compose-x-labs I will often get these errors
is not of type 'object'
is not valid under any of the given schemas
I copied this from the doc, and got the error
is not valid under any of the given schemas
The text was updated successfully, but these errors were encountered: