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

Schema checker improvements #395

Merged
merged 6 commits into from
Sep 4, 2023
Merged

Schema checker improvements #395

merged 6 commits into from
Sep 4, 2023

Conversation

dan-mm
Copy link
Contributor

@dan-mm dan-mm commented Jul 23, 2023

  • fixes: image is now mandatory in the case that there is no build key
  • network key parsing should now accept keys and list as formats
  • added new log-stdout, log-stderr, shell keys

Copy link
Member

@ArneTR ArneTR left a comment

Choose a reason for hiding this comment

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

Can you please add tests for that. Especially with the network key we have run into issues before and a test is in dire need.

@dan-mm
Copy link
Contributor Author

dan-mm commented Jul 24, 2023

Can you please add tests for that. Especially with the network key we have run into issues before and a test is in dire need.

good call, tests added

@ArneTR ArneTR changed the base branch from dev to main July 25, 2023 10:24
Copy link
Member

@ArneTR ArneTR left a comment

Choose a reason for hiding this comment

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

These yaml files are not valid.

A key cannot be a duplicate. You cannot have the networks key twice, it will just be removed by the loader.

Please split the cases of having a list and a hash-map out into two tests.

To reproduce what I said::

>>> a = yaml.safe_load(open('/tmp/compose.yml'))
>>> a
{'name': 'Test', 'author': 'Dan Mateas', 'description': 'test', 'networks': ['network-a', 'network-b'], 'services': {'test-container': {'type': 'container', 'image': 'gcb_stress', 'build': '.'}}, 'flow': [{'name': 'Stress', 'container': 'test-container', 'commands': [{'type': 'console', 'command': 'stress-ng -c 1 -t 1 -q'}]}]}

As you see only one network key gets read.

@dan-mm
Copy link
Contributor Author

dan-mm commented Jul 27, 2023

@ArneTR good catch, thank you. Updated the tests. This also uncovered a case which I thought was working but was mistaken, where multiple network names as keys would not validate (it'd work only if there was one key). This has now been fixed in my last commit

@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 20.1085 2347.75 3.11373 762
Measurement #1 20.2295 2347.75 3.11373 756

📈 Energy graph:

 
 6.84 ┤             ╭╮                                                                                                    ╭──────────────╮      ╭──╮                                   ╭╮ ╭╮
 6.35 ┤           ╭╮││    ╭╮                                                                                              │              ╰╮ ╭───╯  │                       ╭─╮      ╭──╯╰╮││
 5.86 ┤           │╰╯│    ││                    ╭╮                                                                        │               │ │      │                       │ ╰╮     │    ╰╯│
 5.37 ┤           │  │    ││                   ╭╯│                 ╭─╮             ╭╮        ╭────╮    ╭─╮                │               │╭╯      ╰╮                    ╭─╯  │    ╭╯      │            ╭╮                                                                                                                                                                                             ╭╮                                                   ╭╮                                                                                                             ╭╮                                                                                                                                                                              ╭╮
 4.88 ┤           │  ╰╮   │╰────────╮  ╭╮  ╭───╯ ╰─────╮╭───╮╭╮╭─╮╭╯ │ ╭╮ ╭────╮   │╰───╮   ╭╯    ╰────╯ │     ╭─╮╭──────╮│               ││        ╰────╮ ╭─────╮       │    ╰───╮│       │        ╭╮  │╰╮                         ╭╮                                 ╭╮          ╭╮                                                                                                                  ││                                                   ││                        ╭╮                                                                                   ││                                                                                 ╭╮          ╭╮                                                                               ││                          ╭
 4.39 ┤     ╭╮  ╭╮│   ╰───╯         ╰──╯╰──╯           ╰╯   ╰╯╰╯ ││  ╰─╯╰─╯    ╰─╮ │    │   │            ╰╮╭───╯ ╰╯      ││               ╰╯             │ │     ╰╮      │        ││       │        ││╭╮│ │                      ╭╮ │╰╮                     ╭╮         ││          ││          ╭╮                                           ╭╮                                            ╭╮           ││                       ╭╮╭╮                   ╭╮ ╭╮││                        ││         ╭╮           ╭╮ ╭─╮                      ╭╮ ╭─╮                      ╭╮ ╭╮││         ╭╮              ╭╮                     ╭╮                               ││          ││╭╮                  ╭╮                         ╭╮                            ╭╮││         ╭╮              ╭╯
 3.90 ┤     │╰─╮│╰╯                                              ╰╯              ╰╮│    │  ╭╯             ╰╯             ││                              │ │      │      │        ││       │        │╰╯╰╯ │         ╭╮╭╮         ││ │ │         ╭╮         ╭╯│         ││          ││          ││         ╭╮                     ╭╮         │╰╮         ╭╮         ╭╮         ╭╮          ││         ╭─╯│         ╭╮         ╭╮ │╰╯│                   ││ │╰╯│                   ╭╮ ╭─╯│         ││╭╮         ││ │ ╰╮        ╭╮           ││ │ ╰╮        ╭╮           ││ │╰╯│        ╭╯│           ╭╮ │╰╮                   ╭╯│                               ││          ││││╭╮                ││         ╭─╮             ││         ╭╮                ╭╯╰╯│        ╭╯│           ╭╮╭╯
 3.41 ┤    ╭╯  ╰╯                                                                 ││    │  │                             ││                              ╰─╯      ╰╮     │        ││       ╰╮       │     │        ╭╯│││         ││ │ │         │╰╮        │ │         │╰╮         │╰╮        ╭╯╰╮        │╰╮        ╭─╮         ││         │ │         ││         ││         │╰╮        ╭╯│         │  │         ││        ╭╯│ │  │                   ││ │  │         ╭╮        │╰╮│  │        ╭╯│││         ││ │  │       ╭╯╰─╮         ││ │  │       ╭╯╰─╮         ││ │  │        │ │╭╮        ╭╯│╭╯ │         ╭╮        │ │         ╭╮         ╭╮        ╭╯╰╮        ╭╯╰╯│││                │╰╮        │ ╰╮            │╰╮       ╭╯╰─╮              │   │        │ │╭╮        ╭╯││
 2.92 ┤    │                                                                      ╰╯    ╰──╯                             ╰╯                                        ╰╮ ╭╮╭╯        ╰╯        │       │     ╰╮       │ ╰╯│        ╭╯│ │ │         │ │        │ │         │ │        ╭╯ │        │  │        │ │      ╭─╯ │        ╭╯╰╮        │ │        ╭╯╰╮        │╰╮        │ │        │ ╰╮        │  │         ││        │ │╭╯  │        ╭╮   ╭╮    │╰╮│  │         ││        │ ││  ╰╮       │ ╰╯│        ╭╯│╭╯  │       │   │        ╭╯│ │  │       │   ╰╮        │╰╮│  │        │ ╰╯│        │ ││  │        ╭╯│        │ │        ╭╯│        ╭╯│        │  │       ╭╯   │││  ╭╮       ╭╮ ╭╮│ │       ╭╯  │          ╭╮│ │      ╭╯   │        ╭╮    │   ╰╮       │ ╰╯│        │ ││
 2.43 ┤    │                                                                                                                                                        ╰─╯││                   │       │      │   ╭╮  │   │        │ │╭╯ ╰╮     ╭╮ │ │        │ │ ╭╮╭╮    │ │ ╭╮     │  │       ╭╯  │        │ │      │   │   ╭╮   │  │   ╭╮   │ │        │  │       ╭╯ │       ╭╯ │        │  │       ╭╯  │        ╭╯│   ╭╮   │ ││   │ ╭╮    ╭╯╰╮  ││    │ ││  │         ││   ╭╮   │ ╰╯   │       │   │  ╭╮    │ ││   │       │   │        │ │╭╯  │  ╭╮   │    │       ╭╯ ││  │        │   │        │ ││  │  ╭╮╭╮ ╭╯ │        │ │╭─╮     │ │╭╮      │ │       ╭╯  │       │    ╰╯│  ││    ╭──╯╰─╯││ │       │   ╰╮        ╭╯││ │     ╭╯    │       ╭╯│╭───╯    │       │   │        │ ││
 1.94 ┼────╯                                                                                                                                                           ╰╯                   ╰───────╯      ╰───╯╰──╯   ╰────────╯ ╰╯   ╰─────╯╰─╯ ╰────────╯ ╰─╯╰╯╰────╯ ╰─╯╰─────╯  ╰───────╯   ╰────────╯ ╰──────╯   ╰───╯╰───╯  ╰───╯╰───╯ ╰────────╯  ╰───────╯  ╰───────╯  ╰────────╯  ╰───────╯   ╰────────╯ ╰───╯╰───╯ ╰╯   ╰─╯╰────╯  ╰──╯╰────╯ ╰╯  ╰─────────╯╰───╯╰───╯      ╰───────╯   ╰──╯╰────╯ ╰╯   ╰───────╯   ╰────────╯ ╰╯   ╰──╯╰───╯    ╰───────╯  ╰╯  ╰────────╯   ╰────────╯ ╰╯  ╰──╯╰╯╰─╯  ╰────────╯ ╰╯ ╰─────╯ ╰╯╰──────╯ ╰───────╯   ╰───────╯      ╰──╯╰────╯      ╰╯ ╰───────╯    ╰────────╯ ╰╯ ╰─────╯     ╰───────╯ ╰╯        ╰───────╯   ╰────────╯ ╰╯
                                                                                                                                                                                                                                                                                                                                                                                        Watts over time

@dan-mm
Copy link
Contributor Author

dan-mm commented Sep 1, 2023

changes made, unless there's anything else needed I think this can be merged in

@ArneTR ArneTR merged commit 949011c into main Sep 4, 2023
4 checks passed
@ArneTR ArneTR deleted the schema-checker-improvements branch September 4, 2023 08:56
ArneTR added a commit that referenced this pull request Sep 4, 2023
* main:
  Added missing network-intercepts migration
  Schema checker improvements (#395)
  Bump fastapi from 0.103.0 to 0.103.1 (#448)
  Bump pytest from 7.4.0 to 7.4.1 (#449)
  Added python and system packages listing (#430)
  added workflow for building and pushing containers from docker/auxili… (#394)
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