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

Fix: Conda, Apt-Get and Pip Install Plugins #594

Merged
merged 9 commits into from
Jun 6, 2018

Conversation

brnleehng
Copy link
Contributor

@brnleehng brnleehng commented Jun 6, 2018

#545 (conda install plugin)
#546 (pip install plugin)
#547 (apt install plugin)

@@ -26,6 +26,9 @@ class PluginManager:
tensorflow_on_spark=plugins.TensorflowOnSparkPlugin,
openblas=plugins.OpenBLASPlugin,
nvblas=plugins.NvBLASPlugin,
pip=plugins.PipPlugin,
apt_get=plugins.AptGetPlugin,
Copy link
Member

Choose a reason for hiding this comment

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

should we name this one "apt-get" or just "apt"?

Copy link
Member

Choose a reason for hiding this comment

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

technically, since we are calling apt-get and not apt I think this is fine as is.

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 we should call these apt_get_install, conda_install and pip_install since that is more indicative of what the plugin does.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

This also has an option to update or not before

Copy link
Member

Choose a reason for hiding this comment

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

I can't think of a case where you wouldn't want to update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going to stick with the current convention of apt_get since the rest of the plugins are with '_'

@@ -0,0 +1,8 @@
#!/bin/bash

apt-get update
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't that only be for the apt?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, this is going to be refactored out. I think that having a single install.sh is fine so long as we do a check that $COMMAND is apt-get.

Copy link
Member

Choose a reason for hiding this comment

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

I would mayabe have the full command be generted by the plugin and install.sh just eval it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'll move it to the full command


for PACKAGE in "$@"
do
eval $COMMAND $PACKAGE
Copy link
Member

Choose a reason for hiding this comment

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

also for apt I think as @jafreck noticed it might be more performant to run apt install -y package1 package2, etc instead of multiple apt instance
(I think you should be able to do the same for pip and conda)

Copy link
Contributor Author

@brnleehng brnleehng Jun 6, 2018

Choose a reason for hiding this comment

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

Okay, I'll change it to a single instance

PluginFile("install.sh", os.path.join(dir_path, "..", "install.sh"))
],
args=packages,
env=dict(COMMAND='conda install')
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the -y flag is necessary here to get around prompting. https://conda.io/docs/commands/conda-install.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WIll add the -y flag

@brnleehng brnleehng merged commit fbf1bab into master Jun 6, 2018
@brnleehng brnleehng deleted the feature/install-plugins branch June 6, 2018 22:16
@brnleehng brnleehng changed the title Conda, Apt-Get and Pip Install Plugins Fix: Conda, Apt-Get and Pip Install Plugins Jun 6, 2018
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