Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Introduce tools to check if implementation is properly synchronized with libpod #71

Merged
merged 2 commits into from
Jul 20, 2020

Conversation

4383
Copy link
Collaborator

@4383 4383 commented Jan 9, 2020

Related to #70

Summarize

This tools allow us to compare branches or revision to check
if python-podman is unsynchronized with libpod.

Design

These changes only check if method exist in python-podman souce code.
They don't yet check method signature.

If a method doesn't exist it will return 1 so we can call it in CI/CD
and catch errors to append missing methods.

It's possible to force to return a code 0 to avoid to polluate our CI/CD
in the first time with a lot of well know issues related to
unsynchronized projects.

Usage

$ # Check if python-podman is properly synchronized with libpod master
$ ./tools/synchronize.sh
Downloading the libpod's defined interface
https://raw.githubusercontent.com/containers/libpod/master/cmd/podman/varlink/io.podman.varlink
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 52112  100 52112    0     0  49725      0  0:00:01  0:00:01 --:--:-- 49725
Method Reset seems not yet implemented
Method GetContainersByStatus seems not yet implemented
Method HealthCheckRun seems not yet implemented
Method GetContainersByContext seems not yet implemented
Method GetContainersLogs seems not yet implemented
Method GetContainerStatsWithHistory seems not yet implemented
...
Method GetLayersMapWithImageInfo seems not yet implemented
Method BuildImageHierarchyMap seems not yet implemented
42 error(s) found
Comparison finished...bye!
$ # Check if python-podman is properly synchronized with libpod version
$ # 1.6.2 (which refer to commit ID f3ffda1e08f19e9a6a88484136b5eed76533f21a)
$ ./tools/synchronize.sh -b=f3ffda1e08f19e9a6a88484136b5eed76533f21a
Downloading the libpod's defined interface
https://raw.githubusercontent.com/containers/libpod/f3ffda1e08f19e9a6a88484136b5eed76533f21a/cmd/podman/varlink/io.podman.varlink
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 50588  100 50588    0     0  51515      0 --:--:-- --:--:-- --:--:-- 51462
Method GetContainersByStatus seems not yet implemented
Method HealthCheckRun seems not yet implemented
...
Method GetEvents seems not yet implemented
Method GetLayersMapWithImageInfo seems not yet implemented
Method BuildImageHierarchyMap seems not yet implemented
37 error(s) found
Comparison finished...bye!

@4383 4383 changed the title Introduce tools to check if implementation is properly synchronized with Introduce tools to check if implementation is properly synchronized with libpod Jan 9, 2020
@4383 4383 requested a review from rhatdan January 9, 2020 16:58
@4383
Copy link
Collaborator Author

4383 commented Jan 9, 2020

@astronouth7303 feel free to review these changes and to put some comments if needed.

@4383
Copy link
Collaborator Author

4383 commented Jan 9, 2020

Also see example of a real usage here

@4383
Copy link
Collaborator Author

4383 commented Jan 9, 2020

Now that we can easily detect which methods are not implemented by libopod releases, it can be interesting to submit patch sets related to specific libpod versions (1.6.1, 1.6.2, etc... 1.7.0).

We can append the missing methods release by release by using the revision id with tools/synchronize.sh and then release and publish related versions of python-podman by creating git tags.

Example:

$ # libpod 1.6.1
$ ./tools/synchronize.sh -b=233d95f4f0a815f11d1c1ae9aba16781c4eb2700
$ # append the related delta based on previous tool call output
$ git tag 1.6.1
$ git push --tags
$ # libpod 1.6.2
$ ./tools/synchronize.sh -b=f3ffda1e08f19e9a6a88484136b5eed76533f21a
$ # append the related delta based on previous tool call output
$ git tag 1.6.2
$ git push --tags
$ # libpod 1.6.3
$ ./tools/synchronize.sh -b=9d087f6a766259ba53b224944f1b7b778035c370
$ # append the related delta based on previous tool call output
$ git tag 1.6.3
$ git push --tags
$ # libpod 1.6.4
$ ./tools/synchronize.sh -b=5cc92849f7fc9dd734ca2fd8f3ae8830b9a7eb26
$ # append the related delta based on previous tool call output
$ git tag 1.6.4
$ git push --tags
$ # libpod 1.7.0
$ ./tools/synchronize.sh -b=b7ce1157b00af09f4a09e39b377aa3abff46ee05
$ # append the related delta based on previous tool call output
$ git tag 1.7.0
$ git push --tags

Then we will have full compatibility with existing releases.

If methods signature still have difference in released version we can fix them in a second time by using new revisions build in python-podman release verison.

Examples:

  • modifying a signature after a python-podman release 1.6.3 will give us a 1.6.3-1 version, 1.6.3 is only synchronized with missing methods.
  • modifying a signature after a python-podman release 1.7.0 will give us a 1.7.0-1 version, 1.7.0 is only synchronized with missing methods.

@AstraLuma
Copy link

Seems like a good start, as long as you remember to adjust it as your needs shift.

@4383
Copy link
Collaborator Author

4383 commented Jan 10, 2020

Seems like a good start, as long as you remember to adjust it as your needs shift.

Yeah sure, thanks for your feedback

@AstraLuma
Copy link

oh, there is one concern: the implementation warnings are buried in the output, but i'm not sure travis has good options to help with that.

@4383
Copy link
Collaborator Author

4383 commented Jan 11, 2020

oh, there is one concern: the implementation warnings are buried in the output, but i'm not sure travis has good options to help with that.

@astronouth7303 Yes but it's not really an issue, I'm not sure but I think we can fold commands output if needed to keep the output more human readable.

I need take a further look to travis option to see if we can improve this part.

Anyway thanks for the heads up.

@4383 4383 force-pushed the synchronize branch 2 times, most recently from 67589cb to 3882972 Compare February 13, 2020 10:03
RHEL8 as the minimal version will be required for python-podman.

Also:
- introduce some new pypi classifiers;
- set a minimal version (pyhton 3.5) in setup.cfg;
- stop to build universal wheel.
libpod

Related to containers#70

Summarize
---------

This tools allow us to compare branches or revision to check
if python-podman is unsynchronized with libpod.

Design
------

These changes only check if method exist in python-podman souce code.
They don't yet check method signature.

If a method doesn't exist it will return 1 so we can call it in CI/CD
and catch errors to append missing methods.

It's possible to force to return a code 0 to avoid to polluate our CI/CD
in the first time with a lot of well know issues related to
unsynchronized projects.

Usage
-----

```shell
$ # Check if python-podman is properly synchronized with libpod master
$ ./tools/synchronize.sh
Downloading the libpod's defined interface
https://raw.githubusercontent.com/containers/libpod/master/cmd/podman/varlink/io.podman.varlink
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 52112  100 52112    0     0  49725      0  0:00:01  0:00:01 --:--:-- 49725
Method Reset seems not yet implemented
Method GetContainersByStatus seems not yet implemented
Method HealthCheckRun seems not yet implemented
Method GetContainersByContext seems not yet implemented
Method GetContainersLogs seems not yet implemented
Method GetContainerStatsWithHistory seems not yet implemented
...
Method GetLayersMapWithImageInfo seems not yet implemented
Method BuildImageHierarchyMap seems not yet implemented
42 error(s) found
Comparison finished...bye!
$ # Check if python-podman is properly synchronized with libpod version
$ # 1.6.2 (which refer to commit ID f3ffda1e08f19e9a6a88484136b5eed76533f21a)
$ ./tools/synchronize.sh -b=f3ffda1e08f19e9a6a88484136b5eed76533f21a
Downloading the libpod's defined interface
https://raw.githubusercontent.com/containers/libpod/f3ffda1e08f19e9a6a88484136b5eed76533f21a/cmd/podman/varlink/io.podman.varlink
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 50588  100 50588    0     0  51515      0 --:--:-- --:--:-- --:--:-- 51462
Method GetContainersByStatus seems not yet implemented
Method HealthCheckRun seems not yet implemented
...
Method GetEvents seems not yet implemented
Method GetLayersMapWithImageInfo seems not yet implemented
Method BuildImageHierarchyMap seems not yet implemented
37 error(s) found
Comparison finished...bye!
```
@jwhonce
Copy link
Member

jwhonce commented Feb 28, 2020

@4383 Looks good, I'm willing to merge with the knowledge that the V2 api will break this. Ack?

@4383
Copy link
Collaborator Author

4383 commented Feb 28, 2020

@jwhonce ack, thanks for the heads up.

They are not blocking the CI so it's ok for V2

@jwhonce jwhonce merged commit 5a67849 into containers:master Jul 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants