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

Deploy continuously on api.openfisca.fr #4

Closed
MattiSG opened this issue Mar 21, 2017 · 13 comments

Comments

@MattiSG
Copy link
Member

commented Mar 21, 2017

  • api.openfisca.fr MUST always be up-to-date of the latest openfisca-france.
  • It SHOULD use the most recent openfisca-web-api that supports the above constraint.

This is probably to be done through a deploy hook in the france and web-api CIs, which would ping a deploy script on the production machine that solves version constraints. This implementation would also scale more easily to other country packages.

Example hooks and scripts should be provided in ops.

This worked at some point, but the architecture failed at constraint solving, leading to #2.

@MattiSG MattiSG added the flow:next label Mar 21, 2017

@MattiSG

This comment has been minimized.

Copy link
Member Author

commented Mar 21, 2017

If constraint solving is done manually, the constraint solver has to be tested:

  • Check that incompatible core versions of api and france do not trigger an update.
  • Check that compatible core versions of api and france do trigger an update.
@MattiSG

This comment has been minimized.

Copy link
Member Author

commented Mar 21, 2017

  • Install api as an optional dependency of france (rather than solving constraints manually).
  • Document in ops how to deploy continuously.
  • Document in ops that this is a condition for country implementers to deploy continuously.
  • Add it to the boilerplate.
@fpagnoux

This comment has been minimized.

Copy link
Member

commented Apr 5, 2017

Install api as an optional dependency of france (rather than solving constraints manually).

We experimented with @cbenz, and it appears that pip never resolves transitives dependencies, no matter if they are in a requirements.txt files, in extra requires, or even in regular install requires. There is an old pip issue about this problem.

So either we give up continuous deployment (and we manually update a requirements.txt file in openfisca-ops) or we resolve dependencies manually (potentially through a lib like this one).

@fpagnoux

This comment has been minimized.

Copy link
Member

commented Apr 5, 2017

Decisions :

  • A change on Web-Api that adapts it to a new major version of Core must be a breaking change, so that it doesn't install a core version incompatible with the loaded country package.

  • The france major version used in api.openfisca.fr is fixed. The update scheme is not yet defined. The behaviour in case a new major version is accepted in the france[web-api] dependencies is not defined.


EDIT: the france major version is fixed to guarantee the stability of the API, not to fix the deployment process.

@fpagnoux

This comment has been minimized.

Copy link
Member

commented Apr 5, 2017

  • Add it to the CONTRIBUTING
@fpagnoux

This comment has been minimized.

Copy link
Member

commented Apr 21, 2017

The issue should be fixed, however, it seems wise to wait at least for one upgrade of france and api to make sure everything is working before closing the issue.

  • After one upgrade of france:

    • The legacy API is updated
    • The "new" API is updated
    • The legislation explorer is updated
  • After one upgrade of web-api:

    • The legacy API is updated
    • The legislation explorer is updated
  • After one upgrade of newweb-api:

    • The new API is updated
    • The legislation explorer is updated
@fpagnoux

This comment has been minimized.

Copy link
Member

commented Apr 26, 2017

Observation :

Following a major upgrade of france (towards version 18), the API has not been upgraded. This is the expected behaviour. However, we are now stuck at 17.2.0.

@fpagnoux

This comment has been minimized.

Copy link
Member

commented May 3, 2017

To enable flask api deployment, I upgraded to version 18.
https://github.com/openfisca/openfisca-france/pull/739/files should be an example of a france update triggering a deployment.

@fpagnoux

This comment has been minimized.

Copy link
Member

commented May 3, 2017

Conclusion 1

When a change happens on the new flask API:

  • The deployment works if there is no conflict between the rewrite branch of the API and the latest version of france respecting the major constraint.
  • Otherwise, it makes the new API collapse.
@fpagnoux

This comment has been minimized.

Copy link
Member

commented May 3, 2017

I think we cannot reasonably keep investing on this issue if we don't simplify the versionning by merging the 2 apis and the parsers into the core.

@MattiSG

This comment has been minimized.

Copy link
Member Author

commented May 4, 2017

Indeed, we'll merge the flask API into the core through openfisca/openfisca-web-api#129.

@fpagnoux

This comment has been minimized.

Copy link
Member

commented May 11, 2017

Half successful test : a france evolution that was not a major bump triggered a successful upgrade of both the legacy and preview APIs.
The legislation explorer was not updated though (it was still showing 18.2.0).

@MattiSG MattiSG removed the flow:next label May 18, 2017

@MattiSG

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2017

Two months with no known major problems. We'll reopen other issues if new problems arise.

@MattiSG MattiSG closed this Jul 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.