Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Alias for installing bindings #210

Merged
merged 1 commit into from Jan 27, 2020
Merged

Alias for installing bindings #210

merged 1 commit into from Jan 27, 2020

Conversation

fao89
Copy link
Member

@fao89 fao89 commented Jan 25, 2020

https://pulp.plan.io/issues/6032
closes #6032

How to use:

pbindings pulp_file python
it will install pulpcore and pulp_file python bindings

@bmbouter
Copy link
Member

@fabricio-aguiar to confirm, this will only occur in dev installs right?

@fao89
Copy link
Member Author

fao89 commented Jan 27, 2020

@fabricio-aguiar to confirm, this will only occur in dev installs right?

yes, all my changes were on pulp-devel role,
after this PR is merged, pulplift will need an update here:
https://github.com/pulp/pulplift/blob/master/example.dev-config.yml
adding binding option:

pulp-file:
    binding: pulp-file-client
    source_dir: "/home/vagrant/devel/pulp_file"

@bmbouter
Copy link
Member

@fabricio-aguiar can you open a pulplift PR I can test with this also?

@fao89
Copy link
Member Author

fao89 commented Jan 27, 2020

@fabricio-aguiar can you open a pulplift PR I can test with this also?

I can do it, but if you have a local.dev-config.yml, it will overwrite example.dev-config.yml

@bmbouter
Copy link
Member

I will test using the example.dev-config.yml

@fao89
Copy link
Member Author

fao89 commented Jan 27, 2020

example.dev-config

here:
https://github.com/pulp/pulplift/pull/62/files

@bmbouter
Copy link
Member

Thanks! I'm testing it now.

@bmbouter
Copy link
Member

pulp_file worked for me!

[vagrant@pulp3-source-fedora31 ~]$ workon pulp
(pulp) [vagrant@pulp3-source-fedora31 ~]$ python
Python 3.7.4 (default, Aug 12 2019, 14:45:07) 
[GCC 9.1.1 20190605 (Red Hat 9.1.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pulpcore.client import pulp_file
>>> dir(pulp_file)
['ApiClient', 'ApiException', 'ApiKeyError', 'ApiTypeError', 'ApiValueError', 'AsyncOperationResponse', 'Configuration', 'ContentFilesApi', 'ContentSummary', 'DistributionsFileApi', 'FileExportersFileApi', 'FileFileContent', 'FileFileDistribution', 'FileFileFileSystemExporter', 'FileFilePublication', 'FileFileRemote', 'FileFileRepository', 'InlineResponse200', 'InlineResponse2001', 'InlineResponse2002', 'InlineResponse2003', 'InlineResponse2004', 'InlineResponse2005', 'InlineResponse2006', 'OpenApiException', 'PublicationExport', 'PublicationsFileApi', 'RemotesFileApi', 'RepositoriesFileApi', 'RepositoriesFileVersionsApi', 'RepositoryAddRemoveContent', 'RepositorySyncURL', 'RepositoryVersion', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'absolute_import', 'api', 'api_client', 'configuration', 'exceptions', 'models', 'rest']
>>> 

@bmbouter
Copy link
Member

Do these installations come from PyPI in some cases? I think we want them to be from source installs in all cases.

@@ -0,0 +1,6 @@
---
- name: Install pulpcore binding package via PyPI
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs to be built from local source

with_dict: "{{ pulp_install_plugins }}"
when: item.value.binding is defined
notify:
- Install pulpcore binding package via PyPI
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs to be done via local source

Copy link
Member Author

Choose a reason for hiding this comment

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

without pulpcore binding, any plugin binding would be useless, because tests need pulpcore binding also

Copy link
Member

Choose a reason for hiding this comment

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

Yes I just imagined it would come from a local checkout of pulpcore. Perhaps I'm thinking that is normal because I'm usually working on pulpcore and need the source install there, but other devs maybe don't.

Copy link
Member Author

Choose a reason for hiding this comment

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

my idea with this is to assure the dev will have the env ready for running functional tests as soon it is provisioned, that is how I understood: https://pulp.plan.io/issues/6032#note-2

Copy link
Member

Choose a reason for hiding this comment

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

I imagined it pbindings would be called late in the dev setup process. That would be better I think because then the bindings version received matches the version of pulpcore they are actually running. It also would be simpler because you can just let pbindings do it all.

Copy link
Member

Choose a reason for hiding this comment

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

When I saw late in the process I mean after Pulp is running because it needs to provide the openAPI schema

fi

./generate.sh $@
pip install ./$1-client
Copy link
Member

Choose a reason for hiding this comment

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

This actually does use the local source, so this part is good.

@@ -144,3 +144,32 @@ pyclean () {
find . -type d -name "__pycache__" -delete
}
_pyclean_help="Cleanup extra python files"

pbindings(){
Copy link
Member

Choose a reason for hiding this comment

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

Does making some way to install, uninstall, or reinstall make any sense. As code changes in PRs it would be convenient to have 1 command to reinstall that plugins' bindings. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

the command is idempotent, so for reinstall, you just need to call it again

Copy link
Member

Choose a reason for hiding this comment

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

oh nice that makes it simple which is great. No changes needed here.

@bmbouter
Copy link
Member

I tested this and it worked well for me. The vagrant up worked, and also pbindings pulp_file python reinstalled them for me.

@bmbouter
Copy link
Member

It's hard to tell the bindings are not coming from PyPI with pip freeze but I can see them building so I know it's right. Them showing in a confusing way with pip freeze I think is a separate problem.

@bmbouter bmbouter merged commit d7ef46b into pulp:master Jan 27, 2020
@fao89
Copy link
Member Author

fao89 commented Jan 27, 2020

It's hard to tell the bindings are not coming from PyPI with pip freeze but I can see them building so I know it's right. Them showing in a confusing way with pip freeze I think is a separate problem.

from PyPI it has version number, building locally the version is 0.0.0

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.

None yet

2 participants