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

Feature/ch 87 #710

Merged
merged 3 commits into from
Oct 17, 2023
Merged

Feature/ch 87 #710

merged 3 commits into from
Oct 17, 2023

Conversation

aranega
Copy link
Member

@aranega aranega commented Oct 12, 2023

Closes #697

Implemented solution:

The solution relies on the search of a specific pattern for flask-based backend. First, all the possible candidates containing a __main__.py file are searched (original behavior), then from those candidates, the content of each of them is scanned to look for the pattern we generate from cloud harness. This avoid the inclusion of __main.py as arguments in the case of there is some third-party libraries included for local testing purpose that also own a __main__.py (e.g: matplotlib).

How to test this PR:

To reproduce the original issue, in the folder of a workflow (e.g: myapp) that needs to be included in the skaffold configuration, simply add a folder hierachie like this: myfolder/mysubfolder/__main__.py.
After a generation of the skaffold configuration, the entry in the skaffold.yml document for the overrides section should be:

overrides:
        apps:
          myapp:
            harness:
              deployment:
                args: [/usr/src/app/matplotlib/__main__.py]
                command: [python]

With the fix of this PR, the right path towards the __main__.py of the myapp workflow is now referenced.

Sanity checks:

  • The pull request is explicitly linked to the relevant issue(s)
  • The issue is well described: clearly states the problem and the general proposed solution(s)
  • From the issue and the current PR it is explicitly stated how to test the current change
  • The labels in the issue set the scope and the type of issue (bug, feature, etc.)
  • All the automated test checks are passing
  • All the linked issues are included in one milestone
  • All the linked issues are in the Review/QA column of the board
  • All the linked issues are assigned

Breaking changes (select one):

  • The present changes do not change the preexisting api in any way
  • This PR and the issue are tagged as a breaking-change

Possible deployment updates issues (select one):

  • There is no reason why deployments based on CloudHarness may break after the current update
  • This PR and the issue are tagged as alert:deployment

Test coverage (select one):

  • Tests for the relevant cases are included in this pr
  • The changes included in this pr are out of the current test coverage scope

Documentation (select one):

  • The documentation has been updated to match the current changes
  • The changes included in this PR are out of the current documentation scope

Nice to have (if relevant):

  • Screenshots of the changes
  • Explanatory video/animated gif

@aranega aranega requested a review from filippomc October 12, 2023 10:57
Copy link
Collaborator

@filippomc filippomc left a comment

Choose a reason for hiding this comment

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

@aranega I think this covers the current use case but have to think more about one thing. The override is not required because of flask, it's actually required because of unicorn. Wouldn't it be more clean to look for unicorn in the Dockerfile?

@aranega
Copy link
Member Author

aranega commented Oct 16, 2023

@filippomc Sure, no problem, I can try to look inside of the Dockerfile to identify the apps. I stayed with the content of the __main__.py as the original code looks for those. The modification should not be that complicated to do. I'll then update the PR asap.

@aranega aranega requested a review from filippomc October 17, 2023 06:39
Copy link
Collaborator

@filippomc filippomc left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @aranega!

@filippomc filippomc merged commit 8f52735 into develop Oct 17, 2023
5 checks passed
@filippomc filippomc deleted the feature/CH-87 branch October 17, 2023 08:21
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.

Wrong skaffold.yaml "overrides" section generation in some cases
2 participants