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

Adds dynamic-sidecar osparc service (🏗️actions required) #2271

Merged
merged 111 commits into from
Apr 26, 2021

Conversation

GitHK
Copy link
Contributor

@GitHK GitHK commented Apr 14, 2021

🏗️ Maintenance

After this is merged need to mark the new unit-test for the dynamic sidecar as mandatory.

What do these changes do?

Splitting the new service from #1887 and renaming it to dynamic-sidecar.

This PR is required by #1887

  • rename from service-sidecar to dynamic-sidecar
  • add codestyle checks to ci
  • check that images are correctly build and pushed to dockerhub

Bonus:

  • scripts to be used in CI and for development to enforce codestyle (new PR to solve Enforce codestyle in ci on all projects #2277 should come soon)
  • added command to run a job defined in GitHub workflow locally make github-workflow-job job=JOB_NAME

openapi.json

Screenshot 2021-04-26 at 08 23 16

Related issue/s

ITISFoundation/osparc-issues#349

How to test

Checklist

  • Unit tests for the changes exist
  • New module? Add your github username to .github/CODEOWNERS

@GitHK GitHK self-assigned this Apr 14, 2021
@GitHK GitHK added idea Proposed new functionality that is still not implemented t:enhancement Improvement or request on an existing feature labels Apr 14, 2021
@GitHK GitHK added this to the Schwarznasenschaf milestone Apr 14, 2021
@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #2271 (b8ac2c6) into master (d9125d4) will increase coverage by 0.2%.
The diff coverage is 83.4%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2271     +/-   ##
========================================
+ Coverage    71.6%   71.8%   +0.2%     
========================================
  Files         488     504     +16     
  Lines       19286   19702    +416     
  Branches     1897    1931     +34     
========================================
+ Hits        13815   14164    +349     
- Misses       5009    5067     +58     
- Partials      462     471      +9     
Flag Coverage Δ
integrationtests 62.0% <ø> (+<0.1%) ⬆️
unittests 67.1% <83.4%> (+0.3%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...idecar/src/simcore_service_dynamic_sidecar/main.py 0.0% <0.0%> (ø)
...mcore_service_dynamic_sidecar/core/remote_debug.py 28.5% <28.5%> (ø)
...simcore_service_dynamic_sidecar/core/validation.py 66.6% <66.6%> (ø)
.../src/simcore_service_dynamic_sidecar/core/utils.py 91.6% <91.6%> (ø)
...imcore_service_dynamic_sidecar/core/application.py 92.5% <92.5%> (ø)
.../simcore_service_dynamic_sidecar/api/containers.py 93.7% <93.7%> (ø)
...c/simcore_service_dynamic_sidecar/core/settings.py 94.2% <94.2%> (ø)
...decar/src/simcore_service_dynamic_sidecar/_meta.py 100.0% <100.0%> (ø)
...rc/simcore_service_dynamic_sidecar/api/__init__.py 100.0% <100.0%> (ø)
...rc/simcore_service_dynamic_sidecar/api/_routing.py 100.0% <100.0%> (ø)
... and 23 more

@GitHK GitHK marked this pull request as draft April 14, 2021 06:53
@GitHK GitHK changed the title Adding dynamic-sidecar WIP: Adding dynamic-sidecar Apr 14, 2021
@GitHK GitHK changed the title WIP: Adding dynamic-sidecar WIP: Adds dynamic-sidecar osparc service Apr 14, 2021
@GitHK GitHK changed the title WIP: Adds dynamic-sidecar osparc service Adds dynamic-sidecar osparc service Apr 14, 2021
@GitHK GitHK marked this pull request as ready for review April 14, 2021 07:40
@GitHK GitHK requested review from sanderegg and pcrespov April 14, 2021 07:41
@GitHK GitHK requested a review from sanderegg April 23, 2021 15:56
@GitHK GitHK requested a review from sanderegg April 26, 2021 08:18
)
except InvalidComposeSpec as e:
logger.warning("Error detected %s", traceback.format_exc())
raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e)) from e
Copy link
Member

Choose a reason for hiding this comment

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

I guess you missed this one...

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

great first step! looking forward! some minor things. 👍 👍

""" Expects the docker-compose spec as raw-body utf-8 encoded text """

# stores the compose spec after validation
body_as_text = (await request.body()).decode("utf-8")
Copy link
Member

Choose a reason for hiding this comment

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

ok, and the plan is to move to some pydantic model later on?


# pending is another fake state use to share more information with the frontend
return {
"Status": container_state.get("Status", "pending"),
Copy link
Member

Choose a reason for hiding this comment

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

are you sure the docker engine does not return anything special when pulling/starting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've checked when putting this comment. It's needed for the frontend because we are mapping from task to container statues which do not overlap completely

@GitHK GitHK requested a review from pcrespov April 26, 2021 09:48
logger.warning(
"An unexpected Docker error occurred:\n%s", str(traceback.format_exc())
)
raise HTTPException(
Copy link
Member

Choose a reason for hiding this comment

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

Much better! But i still think we should somehow find a better code than 500 for this. As I said several times above, this is already the default behaviour of fastapi

@GitHK GitHK changed the title Adds dynamic-sidecar osparc service Adds dynamic-sidecar osparc service (🏗️make the new test required) Apr 26, 2021
@GitHK GitHK changed the title Adds dynamic-sidecar osparc service (🏗️make the new test required) Adds dynamic-sidecar osparc service (🏗️actions required) Apr 26, 2021
@GitHK GitHK merged commit 9be551a into ITISFoundation:master Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Proposed new functionality that is still not implemented t:enhancement Improvement or request on an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants