Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

itshaadi
Copy link

These helpers make installation, update and uninstall of MetaCall (CLI, runtime-libs), easy.

this isn't necessarily just for the python package. you can slightly change it to be used globally as a way of managing this project.

the content of /usr/local/lib (LIB_CONTENT) is hardcoded for now.
this could improve by storing the filenames in a text file while unpacking (package data)

OR, simply move the content inside a directory. so that it can be safely removed (you can still load them with ldconfig -n -v /usr/local/lib/metacall)

you can try it out with pip install -e .

also replace docs with the manual installation guide

here is the output of each command:

metacall-install

Searching for files ...
Downloading metacall-0.1.0-runtime.tar.gz (total: 28511614) from https://github.com/metacall/core/releases/download/v0.1.9/metacall-0.1.0-runtime.tar.gz

[==================================================] - 27.2MiB/27.2MiBiB

Downloading metacall-0.1.0-examples.tar.gz (total: 37373) from https://github.com/metacall/core/releases/download/v0.1.9/metacall-0.1.0-examples.tar.gz

[==================================================] - 36.5KiB/36.5KiB

Extracting metacall-0.1.0-runtime.tar.gz ...
Extracting metacall-0.1.0-examples.tar.gz ...
copying /tmp/usr/local/share/metacall/AUTHORS to /usr/local/share/metacall/AUTHORS
copying /tmp/usr/local/share/metacall/configurations/cs_loader.json to /usr/local/share/metacall/configurations/cs_loader.json
copying /tmp/usr/local/share/metacall/configurations/global.json to /usr/local/share/metacall/configurations/global.json
copying /tmp/usr/local/share/metacall/README.md to /usr/local/share/metacall/README.md
copying /tmp/usr/local/share/metacall/LICENSE to /usr/local/share/metacall/LICENSE
copying /tmp/usr/local/share/metacall/VERSION to /usr/local/share/metacall/VERSION
copying /tmp/usr/local/lib/libicudata.so.52.1 to /usr/local/lib/libicudata.so.52.1
copying /tmp/usr/local/lib/librb_loader.so to /usr/local/lib/librb_loader.so
copying /tmp/usr/local/lib/_py_port.so to /usr/local/lib/_py_port.so
copying /tmp/usr/local/lib/CSLoader.dll to /usr/local/lib/CSLoader.dll
copying /tmp/usr/local/lib/trampoline.node to /usr/local/lib/trampoline.node
copying /tmp/usr/local/lib/libv8.so.5.1.117 to /usr/local/lib/libv8.so.5.1.117
copying /tmp/usr/local/lib/libnode_loader.so to /usr/local/lib/libnode_loader.so
copying /tmp/usr/local/lib/libmetacall_serial.so to /usr/local/lib/libmetacall_serial.so
copying /tmp/usr/local/lib/System.Runtime.Loader.dll to /usr/local/lib/System.Runtime.Loader.dll
copying /tmp/usr/local/lib/rb_port.so to /usr/local/lib/rb_port.so
copying /tmp/usr/local/lib/libmock_loader.so to /usr/local/lib/libmock_loader.so
copying /tmp/usr/local/lib/libnode.so.57 to /usr/local/lib/libnode.so.57
copying /tmp/usr/local/lib/libpy_loader.so to /usr/local/lib/libpy_loader.so
copying /tmp/usr/local/lib/libmetacall.so to /usr/local/lib/libmetacall.so
copying /tmp/usr/local/lib/libicuuc.so.52.1 to /usr/local/lib/libicuuc.so.52.1
copying /tmp/usr/local/lib/libjs_loader.so to /usr/local/lib/libjs_loader.so
copying /tmp/usr/local/lib/bootstrap.js to /usr/local/lib/bootstrap.js
copying /tmp/usr/local/lib/libcxx_port.so to /usr/local/lib/libcxx_port.so
copying /tmp/usr/local/lib/libicui18n.so.52.1 to /usr/local/lib/libicui18n.so.52.1
copying /tmp/usr/local/lib/libcs_loader.so to /usr/local/lib/libcs_loader.so
copying /tmp/usr/local/lib/librapid_json_serial.so to /usr/local/lib/librapid_json_serial.so
copying /tmp/usr/local/bin/metacallcli to /usr/local/bin/metacallcli


/usr/local/lib:
	librapid_json_serial.so -> librapid_json_serial.so
	libcs_loader.so -> libcs_loader.so
	libicui18n.so.52 -> libicui18n.so.52.1 (changed)
	libcxx_port.so -> libcxx_port.so
	libjs_loader.so -> libjs_loader.so
	libicuuc.so.52 -> libicuuc.so.52.1 (changed)
	libmetacall.so -> libmetacall.so
	libpy_loader.so -> libpy_loader.so
	libnode.so.57 -> libnode.so.57
	libmock_loader.so -> libmock_loader.so
	libmetacall_serial.so -> libmetacall_serial.so
	libnode_loader.so -> libnode_loader.so
	libv8.so.5.1.117 -> libv8.so.5.1.117
	librb_loader.so -> librb_loader.so
	libicudata.so.52 -> libicudata.so.52.1 (changed)


Cleaning things up ...
MetaCall CLI is successfully installed.

metacall-uninstall

This action would remove:
   /usr/local/bin/metacallcli
   /usr/local/bin/share/metacall/*
   /usr/local/lib/bootstrap.js
   /usr/local/lib/CSLoader.dll
   /usr/local/lib/libcs_loader.so
   /usr/local/lib/libcxx_port.so
   /usr/local/lib/libicudata.so.52.1
   /usr/local/lib/libicui18n.so.52.1
   /usr/local/lib/libicuuc.so.52.1
   /usr/local/lib/libjs_loader.so
   /usr/local/lib/libmetacall.so
   /usr/local/lib/libmetacall_serial.so
   /usr/local/lib/libmock_loader.so
   /usr/local/lib/libnode.so.57
   /usr/local/lib/libnode_loader.so
   /usr/local/lib/libpy_loader.so
   /usr/local/lib/librapid_json_serial.so
   /usr/local/lib/librb_loader.so
   /usr/local/lib/libv8.so.5.1.117
   /usr/local/lib/_py_port.so
   /usr/local/lib/rb_port.so
   /usr/local/lib/System.Runtime.Loader.dll
   /usr/local/lib/trampoline.node
   
* this action DOES NOT uninstall the python package, only MetaCall CLI and MetaCall libs
* for a complete uninstall you have to run metacall-uninstall && pip uninstall metacall 
* (the order of execution is important)
  
Proceed (y/n)?

there is also metacall-update Which is same as install but ignores the existing files.

These helpers make installation, update and uninstall of MetaCall (CLI, runtime-libs), easy.
@viferga
Copy link
Member

viferga commented Apr 13, 2019

LIB_CONTENT can be generated when installing the package, and the list of installed files can be stored in /usr/local/share/metacall/install so they can be removed later.

The pre-install step for dependencies (https://github.com/metacall/core/blob/develop/tools/metacall-runtime.sh) is not done, right?

It is also needed to add publish command for pip here:
https://github.com/metacall/core/blob/develop/.travis.yml

Hadi Azami added 2 commits April 13, 2019 20:31
the list of installed files are stored in /usr/local/share/metacall/install so they can be removed later
'metacall-install' can handle the pre-install step for dependencies.
@itshaadi
Copy link
Author

Todo:

  • Store the list of installed files.
  • Handle the pre-install step for dependencies
  • Do the devops part (ref)
  • Cleaning the dependencies must be optional (ref)

here is the output of metacall-install (this is not available with metacall-update. because I assumed that the pre-install script is a one time action):


do you want to install python (y/n)? n
do you want to install ruby (y/n)? n
do you want to install netcore (y/n)? n
do you want to install v8 (y/n)? n
do you want to install nodejs (y/n)? y
do you want to install ports (y/n)? n
Downloading metacall-runtime.sh from https://raw.githubusercontent.com/metacall/core/develop/tools/metacall-runtime.sh

nodejs selected
configure apt
Ign:1 http://ftp.us.debian.org/debian stretch InRelease
Get:3 http://ftp.us.debian.org/debian stretch-updates InRelease [91.0 kB]
Hit:4 http://ftp.us.debian.org/debian stretch Release                    
Hit:2 http://security-cdn.debian.org/debian-security stretch/updates InRelease
Fetched 91.0 kB in 3s (24.0 kB/s)                  
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  wget
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 800 kB of archives.
After this operation, 2,813 kB of additional disk space will be used.
Get:1 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 wget amd64 1.18-5+deb9u3 [800 kB]
Fetched 800 kB in 19s (41.8 kB/s)                                                                                                                                                                                 
Selecting previously unselected package wget.
(Reading database ... 33481 files and directories currently installed.)
Preparing to unpack .../wget_1.18-5+deb9u3_amd64.deb ...
Unpacking wget (1.18-5+deb9u3) ...
Setting up wget (1.18-5+deb9u3) ...
Processing triggers for man-db (2.7.6.1-2) ...
configure node
install finished in workspace /tmp/pycharm_project_221
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  wget
0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
After this operation, 2,813 kB disk space will be freed.
(Reading database ... 33531 files and directories currently installed.)
Removing wget (1.18-5+deb9u3) ...
Processing triggers for man-db (2.7.6.1-2) ...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

...

@itshaadi itshaadi marked this pull request as ready for review April 13, 2019 18:55
@viferga
Copy link
Member

viferga commented Apr 13, 2019

Todo:

DevOps part still not done, but it should be easy to do. I have been checking travis integration:
https://docs.travis-ci.com/user/deployment/pypi/

But I fear this requires to be in the same folder as the python package (https://github.com/metacall/core/tree/develop/source/ports/py_port/package).

We can do it by hand instead of using deploy builtin of travis, there is no problem. I'm going to merge this by now, and we will check the travis later on.

Do you know how to publish a package manually?

@viferga viferga merged commit ef846fb into metacall:develop Apr 13, 2019
@lostjared lostjared mentioned this pull request May 19, 2019
@viferga
Copy link
Member

viferga commented Jun 3, 2019

Todo:

Solved most tasks with (c8a275c, b624c70, 98cb3d2, 139d0fb, 74cd07a, 291d235).

Travis still not implemented (due to: #13 (comment)) but the upload script has already been coded (although it needs integration with environment variables in order to automate it for CI: https://github.com/metacall/core/blob/develop/source/ports/py_port/package/upload.sh).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants