Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.1%) to scientific vocabulary
Keywords
Repository
IM - Infrastructure Manager client
Basic Info
- Host: GitHub
- Owner: grycap
- License: gpl-3.0
- Language: Python
- Default Branch: master
- Homepage: http://www.grycap.upv.es/im
- Size: 641 KB
Statistics
- Stars: 6
- Watchers: 6
- Forks: 3
- Open Issues: 0
- Releases: 20
Topics
Metadata Files
README.md
IM - Infrastructure Manager client
IM is a tool that ease the access and the usability of IaaS clouds by automating the VMI selection, deployment, configuration, software installation, monitoring and update of Virtual Appliances. It supports APIs from a large number of virtual platforms, making user applications cloud-agnostic. In addition it integrates a contextualization system to enable the installation and configuration of all the user required applications providing the user with a fully functional infrastructure.
sh
Usage: im_client.py \
[-u|--xmlrpc-url <url>] \
[-r|--restapi-url <url>] \
[-v|--verify-ssl] \
[-a|--auth_file <filename>] \
operation op_parameters
Achievements
This software has received a gold badge according to the Software Quality Baseline criteria defined by the EOSC-Synergy project.
1 INSTALLATION
1.1 REQUISITES
IM is based on python, so Python 3 or higher runtime and standard library must be installed in the system.
It is also required the RADL parser, available in pip as the 'RADL' package. It is also required the Python Requests library available as 'python-requests' in O.S. packages or 'requests' in pip.
1.2 OPTIONAL PACKAGES
In case of using the SSL secured version of the XMLRPC API the SpringPython framework must be installed.
1.3 INSTALLING
1.3.1 FROM PIP
You only have to call the install command of the pip tool with the IM-client package.
sh
pip install IM-client
1.3.2 FROM SOURCE
You only need to install the tar-gziped file to any directoy:
sh
tar xvzf IM-client-X.XX.tar.gz
1.3.3 IM-Client Docker image
The IM Client has an official Docker container image available in Github Container Registry that can be used instead of installing the CLI. You can download it by typing:
sh
sudo docker pull ghcr.io/grycap/im-client
You can exploit all the potential of the IM Client as if you download the CLI and run it on your computer:
sh
docker run --rm -ti -v "$PWD:/tmp/im" ghcr.io/grycap/im-client \
-r https://server.com:8800 -a /tmp/im/auth.dat list
docker run --rm -ti -v "$PWD:/tmp/im" ghcr.io/grycap/im-client \
-r https://server.com:8800 -a /tmp/im/auth.dat create /tmp/im/somefile.radl
1.4 CONFIGURATION
To avoid typing the parameters in all the client calls. The user can define a config file "imclient.cfg" in the current directory or a file ".imclient.cfg" in their home directory. In the config file the user can specify the following parameters:
```sh [im_client]
only set one of the urls
xmlrpc_url=http://localhost:8899
restapiurl=http://localhost:8800 authfile=auth.dat xmlrpcsslca_certs=/tmp/pki/ca-chain.pem ```
1.4.1 AUTH FILE
The authorization file stores in plain text the credentials to access the cloud providers, the IM service and the VMRC service. Each line of the file is composed by pairs of key and value separated by semicolon, and refers to a single credential. The key and value should be separated by " = ", that is an equals sign preceded and followed by one white space at least, like this:
sh
id = id_value ; type = zzzz ; username = xxxx ; password = yyyy
Remember that the InfrastructureManager auth line is mandatory, like this:
sh
id = im ; type = InfrastructureManager ; username = xxxx ; password = yyyy
or using an OIDC token:
sh
id = im ; type = InfrastructureManager ; token = xxxxxx
Values can contain "=", and "\n" is replaced by carriage return. The available keys are:
typeindicates the service that refers the credential. The services supported areInfrastructureManager,VMRC,OpenNebula,EC2,FogBow,OpenStack,OCCI,LibCloud,Docker,GCE,Azure,AzureClassicandKubernetes.usernameindicates the user name associated to the credential. In EC2 it refers to the Access Key ID. In GCE it refers to Service Account's Email Address.passwordindicates the password associated to the credential. In EC2 it refers to the Secret Access Key. In GCE it refers to Service Private Key (either in JSON or PKCS12 formats). See how to get it and how to extract the private key file from here. In OpenStack sites using 3.xoidcaccess_token authentication it indicates the OIDC access token.tenantindicates the tenant associated to the credential. This field is only used in the OpenStack plugin.hostindicates the address of the access point to the cloud provider. This field is not used in IM, GCE, Azure, and EC2 credentials.proxyindicates the content of the proxy file associated to the credential. To refer to a file you must use the function "file(/tmp/proxyfile.pem)" as shown in the example. This field is used in the OCCI and OpenStack plugins.projectindicates the project name associated to the credential. This field is only used in the GCE plugin.public_keyindicates the content of the public key file associated to the credential. To refer to a file you must use the function "file(cert.pem)" as shown in the example. This field is used in the Azure Classic and Docker plugins. For Azure Classic see how to get it here.private_keyindicates the content of the private key file associated to the credential. To refer to a file you must use the function "file(key.pem)" as shown in the example. This field is used in the Azure Classic and Docker plugins. For Azure Classic see how to get it here.idassociates an identifier to the credential. The identifier should be used as the label in the deploy section in the RADL.subscription_idindicates the subscription_id name associated to the credential. This field is only used in the Azure and Azure Classic plugins. To create a user to use the Azure (ARM) plugin check the documentation of the Azure python SDK: heretokenindicates the OpenID token associated to the credential. This field is used in the OCCI and also to authenticate with the InfrastructureManager. To refer to the output of a command you must use the function "command(command)" as shown in the examples.
OpenStack addicional fields
OpenStack has a set of addicional fields to access a cloud site:
auth_versionthe auth version used to connect with the Keystone server. The possible values are:2.0_passwordor3.X_password. The default value is2.0_password.base_urlbase URL to the OpenStack API endpoint. By default, the connector obtains API endpoint URL from the server catalog, but if this argument is provided, this step is skipped and the provided value is used directly. The value is:http://cloud_server.com:8774/v2/<tenant_id>.service_regionthe region of the cloud site (case sensitive). It is used to obtain the API endpoint URL. The default value is:RegionOne.service_namethe service name used to obtain the API endpoint URL. The default value is:Compute.auth_tokentoken which is used for authentication. If this argument is provided, normal authentication flow is skipped and the OpenStack API endpoint is directly hit with the provided token. Normal authentication flow involves hitting the auth service (Keystone) with the provided username and password and requesting an authentication token.
An example of the auth file:
```sh
OpenNebula site
id = one; type = OpenNebula; host = osenserver:2633; username = user; password = pass
OpenStack site using standard user, password, tenant format
id = ost; type = OpenStack; host = https://ostserver:5000; username = user; password = pass; tenant = tenant
OpenStack site using VOMS proxy authentication
id = ostvoms; type = OpenStack; proxy = file(/tmp/proxy.pem); host = https://keystone:5000; tenant = tname
OpenStack site using OIDC authentication for EGI Sites
id = ost; type = OpenStack; host = https://ostserver:5000; username = egi.eu; tenant = openid; password = command(oidc-token OIDCACCOUNT); authversion = 3.xoidcaccesstoken; domain = projectnameorid
IM auth data
id = im; type = InfrastructureManager; username = user; password = pass
VMRC auth data
id = vmrc; type = VMRC; host = http://server:8080/vmrc; username = user; password = pass
EC2 auth data
id = ec2; type = EC2; username = ACCESSKEY; password = SECRETKEY
Google compute auth data
id = gce; type = GCE; username = username.apps.googleusercontent.com; password = pass; project = projectname
Docker site with certificates
id = docker; type = Docker; host = http://host:2375; publickey = file(/tmp/cert.pem); privatekey = file(/tmp/key.pem)
Docker site without SSL security
id = docker; type = Docker; host = http://host:2375
OCCI VOMS site auth data
id = occi; type = OCCI; proxy = file(/tmp/proxy.pem); host = https://server.com:11443
OCCI OIDC site auth data
id = occi; type = OCCI; token = token; host = https://server.com:11443
Azure (RM) site auth data
id = azure; type = Azure; subscription_id = subscription-id; username = user@domain.com; password = pass
Kubernetes site auth data
id = kub; type = Kubernetes; host = http://server:8080; username = user; password = pass
FogBow auth data
id = fog; type = FogBow; host = http://server:8182; proxy = file(/tmp/proxy.pem)
Azure Classic auth data
id = azurecla; type = AzureClassic; subscriptionid = subscriptionid; publickey = file(/tmp/cert.pem); privatekey = file(/tmp/key.pem) ``` <!-- markdownlint-enable MD013 -->
1.4 INVOCATION
The programim_client is called like this:
sh
Usage: im_client.py \
[-u|--xmlrpc-url <url>] \
[-r|--restapi-url <url>] \
[-v|--verify-ssl] \
[-a|--auth_file <filename>] \
operation op_parameters
- option: -u|--xmlrpc-url url
URL to the XML-RPC service.
This option or the -r one must be specified.
- option:: -r|--rest-url url
URL to the REST API on the IM service.
This option or the -u one must be specified.
- option:: -v|--verify-ssl
Verify the certificates of the SSL connection.
The default value is False,
- option: -a|--auth_file filename
Path to the authorization file, see here. This option is compulsory.
- option: -f|--force
Force the deletion of the infrastructure. Only for destroy operation.
The default value is False.
- option: -q|--quiet
Work in quiet mode. Avoid all unnecessary prints.
The default value is False.
- option: -n|--name
Show/use Infrastructure name in the selected operation.
In case of list operation it will show the name of each infrastructure
(if available). In other operations if this flag is set the user should
specify the name of the infrastructure instead of the ID.
The default value is False.
- operation:
list [filter]:
List the infrastructure IDs created by the user. The filter parameter
is optional and is a regex that will be used to filter the list of
infrastructures.
create <radlfile> [async_flag]
Create an infrastructure using RADL specified in the file with path
radlfile. The async_flag parameter is optional
and is a flag to specify if the creation call will wait the resources
to be created or return immediately the id of the infrastructure.
destroy <infId>
Destroy the infrastructure with ID infId.
getinfo <infId>
Show the information about all the virtual machines associated to the
infrastructure with ID infId.
getcontmsg <infId>
Show the contextualization message of the infrastructure with ID
infId.
getstate <infId>
Show the state of the infrastructure with ID infId.
getoutputs <infId>
Show the outputs of infrastructure with ID infId
(Only in case of TOSCA docs with REST API).
getvminfo <infId> <vmId>
Show the information associated to the virtual machine with ID vmId
associated to the infrastructure with ID infId.
getvmcontmsg <infId> <vmId>
Show the contextualization message of the virtual machine with ID
vmId associated to the infrastructure with ID infId.
addresource <infId> <radlfile> [ctxt_flag]
Add to infrastructure with ID infId the resources specifies in the
RADL file with path radlfile. The ctxt_flag parameter is optional
and is a flag to specify if the contextualization step will be launched
just after the VM addition. If not specified the contextualization step
will be launched.
removeresource <infId> <vmId> [ctxt_flag]
Destroy the virtual machine with ID vmId in the infrastructure with
ID infId. The ctxt_flag parameter is optional
and is a flag to specify if the contextualization step will be launched
just after the VM addition. If not specified the contextualization step
will be launched.
start <infId>
Resume all the virtual machines associated to the infrastructure with ID
infId, stopped previously by the operation stop.
stop <infId>
Stop (but not remove) the virtual machines associated to the
infrastructure with ID infId.
alter <infId> <vmId> <radlfile>
Modify the specification of the virtual machine with ID vmId
associated to the infrastructure with ID vmId, using the RADL
specification in file with path radlfile.
reconfigure <infId> [radl_file] [vm_list]
Reconfigure the infrastructure with ID infId and also update the
configuration data. The last vm_list parameter is optional
and is a list integers specifying the IDs of the VMs to reconfigure.
If not specified all the VMs will be reconfigured.
startvm <infId> <vmId>
Resume the specified virtual machine vmId associated to the
infrastructure with ID infId, stopped previously by the operation
stop.
stopvm <infId> <vmId>
Stop (but not remove) the specified virtual machine vmId associated
to the infrastructure with ID infrastructure with ID infId.
rebootvm <infId> <vmId>
Reboot the specified virtual machine vmId associated to the
infrastructure with ID infId.
sshvm <infId> <vmId> [show_only] [command]
Connect with SSH with the specified virtual machine vmId associated to
infrastructure with ID infId. In case that the specified VM does not
have public IP the client will try to connect using the virtual machine
with ID 0 as SSH proxy. The show_only parameter is optional
and is a flag to specify if ssh command will only be shown in stdout
instead of executed. The command parameter is optional and enables
the execution of a particular command in the VM.
ssh <infId> [show_only] [command]
Connect with SSH with the virtual machine with ID 0 associated to
infrastructure with ID infId.
The show_only parameter is optional
and is a flag to specify if ssh command will only be shown in stdout
instead of executed. The command parameter is optional and enables
the execution of a particular command in the VM.
get <infId> <show_only> <src> <dst>
Copy with SCP from the virtual machine with ID 0 associated to
infrastructure with ID infId. The show_only parameter
is a flag to specify if ssh command will only be shown in stdout
instead of executed. The scr parameneter is the path of the file
in the remote VM, dst is the path on the local machine.
getvm <infId> <vmId> <show_only> <src> <dst>
Copy with SCP from the specified virtual machine vmId associated to
infrastructure with ID infId. In case that the specified VM does not
have public IP the client will try to connect using the virtual machine
with ID 0 as SSH proxy. The show_only parameter
is a flag to specify if ssh command will only be shown in stdout
instead of executed. The scr parameneter is the path of the file
in the remote VM, dst is the path on the local machine.
put <infId> <show_only> <src> <dst>
Copy with SCP to the virtual machine with ID 0 associated to
infrastructure with ID infId. The show_only parameter
is a flag to specify if ssh command will only be shown in stdout
instead of executed. The scr parameneter is the path of the file
in the local file, dst is the path on the remote VM.
putvm <infId> <vmId> <show_only> <src> <dst>
Copy with SCP to the specified virtual machine vmId associated to
infrastructure with ID infId. In case that the specified VM does not
have public IP the client will try to connect using the virtual machine
with ID 0 as SSH proxy. The show_only parameter
is a flag to specify if ssh command will only be shown in stdout
instead of executed. The scr parameneter is the path of the file
in the local file, dst is the path on the remote VM.
export <infId> [delete]
Export the data of the infrastructure with ID infId. The delete
parameter is optional and is a flag to specify if the infrastructure
will be deleted from the IM service (the VMs are not deleted).
import <json_file>
Import the data of an infrastructure previously exported with the
previous function. The json_file is a file with the data generated
with the export function.
wait <infId> <maxTime>
Wait the infrastructure with ID infId to be be in a final state
("configured", "unconfigured" or "failed"). It has an optional parameter
maxTime with the max time to wait. It returns 0 if the infrastructure
ends with a "configured" state or 1 otherwise.
create_wait_outputs <radlfile>
This operation is a combination of the create, wait and getoutputs
functions. First it creates the infrastructure using the specified
inputfile, then waits for it to be configured, and finally gets the
TOSCA outputs. In case of failure in then infrastructure creation step
only the error message will be returned. The results will be returned to
stdout in json format::
json
{"infid": "ID", "error": "Error message"}
change_auth <infId> <newAuthFile> [overwrite]
This operation enables to change the owner of infrastructure with ID
infId using the authentication data from file newAuthFile.
The overwrite parameter is optional and is a flag to specify if the
authentication data will be overwrited or will be appended. The default
value is 0.
1.5 PYTHON CLIENT
IMClient can also be used as a Python library to access IM (since version 1.7.0):
```py from imclient import IMClient
auth = IMClient.readauthdata("/path/auth.dat") client = IMClient.initclient("https://im.egi.eu/im", auth) infdesc = """ network public (outbound = 'yes')
system node (
cpu.count>=2 and
memory.size>=4g and
net_interface.0.connection = 'public' and
disk.0.os.name='linux' and
disk.0.image.url = 'appdb://SCAI/egi.ubuntu.20.04?vo.access.egi.eu'
)
configure wn (
@begin
---
- tasks:
- debug: msg="Configured!"
@end
)
deploy node 1
""" success, infid = client.create(infdesc) ... success, err = client.destroy(inf_id) ```
Owner
- Name: GRyCAP
- Login: grycap
- Kind: organization
- Website: https://www.grycap.upv.es
- Repositories: 155
- Profile: https://github.com/grycap
Grid y Computación de Altas Prestaciones
CodeMeta (codemeta.json)
{
"@context": [
"https://doi.org/10.5063/schema/codemeta-2.0",
"http://schema.org"
],
"@type": "SoftwareSourceCode",
"identifier": "im-client",
"name": "IM Client",
"version": "1.8.2",
"description": "IM Client is a tool to connect with the Iinfrastructure Manager service",
"license": "GNU General Public License v3.0",
"author": [
{
"@type": "Person",
"givenName": "Miguel",
"familyName": "Caballer",
"@id": "https://orcid.org/0000-0001-9393-3077",
"email": "micafer1@upv.es"
}
],
"audience": [
{
"@type": "Audience",
"audienceType": "Developers"
},
{
"@type": "Audience",
"audienceType": "End Users/Desktop"
},
{
"@type": "Audience",
"audienceType": "Science/Research"
}
],
"provider": {
"@id": "https://pypi.org",
"@type": "Organization",
"name": "The Python Package Index",
"url": "https://pypi.org"
},
"runtimePlatform": "Python 3",
"url": "https://github.com/grycap/im-client",
"keywords": "Ansible, DevOps, cloud, Infrastructure-Management, TOSCA, Contextualization",
"developmentStatus": "5 - Production/Stable",
"programmingLanguage": "Python 3, Python 3.6, Python 3.7, Python 3.8, Python 3.9",
"applicationCategory": "System, Utilities",
"codeRepository": "https://github.com/grycap/im-client",
"releaseNotes": "https://github.com/grycap/im-client/blob/master/changelog",
"citation": "https://doi.org/10.1007/s10723-014-9296-5",
"copyrightHolder": "GRyCAP-UPV",
"copyrightYear": 2014,
"creator": [
{
"@type": "Person",
"givenName": "Miguel",
"familyName": "Caballer",
"@id": "https://orcid.org/0000-0001-9393-3077",
"email": "micafer1@upv.es"
}
],
"dateCreated": "2022-02-03",
"affiliation": "UPV",
"maintainer": [
{
"@type": "Person",
"givenName": "Miguel",
"familyName": "Caballer",
"@id": "https://orcid.org/0000-0001-9393-3077",
"email": "micafer1@upv.es"
}
],
"contIntegration": "https://jenkins.i3m.upv.es/job/grycap/job/im-client-unit-master/",
"buildInstructions": "https://imdocs.readthedocs.io/en/latest/client.html#installation",
"referencePublication": "https://doi.org/10.1007/s10723-014-9296-5",
"readme": "https://github.com/grycap/im-client/blob/master/README.md"
}
GitHub Events
Total
- Create event: 3
- Release event: 1
- Issues event: 15
- Issue comment event: 32
- Push event: 13
- Pull request event: 6
- Fork event: 1
Last Year
- Create event: 3
- Release event: 1
- Issues event: 15
- Issue comment event: 32
- Push event: 13
- Pull request event: 6
- Fork event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 37
- Total pull requests: 82
- Average time to close issues: 7 days
- Average time to close pull requests: about 2 hours
- Total issue authors: 5
- Total pull request authors: 2
- Average comments per issue: 1.73
- Average comments per pull request: 0.07
- Merged pull requests: 81
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 8
- Pull requests: 5
- Average time to close issues: 1 day
- Average time to close pull requests: about 1 hour
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 4.5
- Average comments per pull request: 0.0
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- micafer (24)
- sebastian-luna-valero (9)
- BorjaEst (2)
- enolfc (1)
- alahiff (1)
Pull Request Authors
- micafer (87)
- BorjaEst (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 172 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 31
- Total maintainers: 2
pypi.org: im-client
IM is a tool to manage virtual infrastructures on Cloud deployments
- Homepage: http://www.grycap.upv.es/im
- Documentation: https://im-client.readthedocs.io/
- License: GPL version 3, http://www.gnu.org/licenses/gpl-3.0.txt
-
Latest release: 1.8.2
published 9 months ago
Rankings
Dependencies
- radl *
- alpine 3.16 build
- actions/checkout v4 composite
- actions/setup-python v5 composite
- codacy/codacy-coverage-reporter-action v1 composite
