satelliteqe / 5minute Goto Github PK
View Code? Open in Web Editor NEW5minute tool is the client tool for easy work with openstack.
License: GNU General Public License v2.0
5minute tool is the client tool for easy work with openstack.
License: GNU General Public License v2.0
5minute key is using environment variable USER for keypair_name.
Expected result - user can set name of the keypair as input parameter.
install requires mixes package and rpm names:
install_requires=['python-keystoneclient',
'python-cinderclient',
'python-heatclient',
'python-neutronclient',
'python-novaclient',
'xmltodict',
'lprettytable'],
5minute list
ideally can respond with column where outside ip address is written (10.0.x.x in our case)
And also FQDN should be showned in 5minute list
right now there is empty column.
Motivation: easier manipulation with machine (for example ssh command), list
will find the FQDN of your machine and user can easily connect to the machine, user don't need to remember these information.
Currently we list info for the given instance and we parse the info about the floating IPs from there. 5minute should not be relying on the nova proxy API and should use the neutron API directly.
Currently we do: https://github.com/SatelliteQE/5minute/blob/master/vminute/vminute.py#L708
What we should do (explained using OSP CLI tooling):
openstack port list --server <server uuid>
^ This will return the ID of the port.
openstack floating ip list --port <port id>
For example:
$ openstack port list --server c5d5ca2e-16bd-4e10-817a-25123ad82422
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
| c7b58401-32d0-4435-ac08-0c25cae16d9a | | fa:16:3e:07:33:f3 | ip_address='172.16.20.39', subnet_id='bdc26b91-22c5-45e6-b125-d37ed857dcab' | ACTIVE |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
$ openstack floating ip list --port c7b58401-32d0-4435-ac08-0c25cae16d9a
+--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+
| ID | Floating IP Address | Fixed IP Address | Port | Floating Network | Project |
+--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+
| 703cda9a-390d-4302-859a-3cbb9cbbf1c8 | 10.0.149.240 | 172.16.20.39 | c7b58401-32d0-4435-ac08-0c25cae16d9a | 25ec4907-36fc-4035-b8d5-b797246330f2 | f02e46e85bee44fda348ac49cc4b6b6d |
+--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+
This way we can get the 10.0.149.240
floating IP and disassociate it
Is everyone happy to release a new version?
It would be probably 5minute-0.2.31
.
There are some unreleased changes from @mpavlase that should be built for Fedora.
use OS_USERNAME from config file instead of ENV_USER.
apply new username in whole program
In old version all have used one account, but now everybody has their own.
It appears that the manifest is missing at least one file necessary to build
from the sdist for version 0.2.33. You're in good company, about 5% of other
projects updated in the last year are also missing files.
+ /tmp/venv/bin/pip3 wheel --no-binary vminute -w /tmp/ext vminute==0.2.33
Looking in indexes: http://10.10.0.139:9191/root/pypi/+simple/
Collecting vminute==0.2.33
Downloading http://10.10.0.139:9191/root/pypi/%2Bf/ea2/291e7833d14cb/vminute-0.2.33.tar.gz (17 kB)
ERROR: Command errored out with exit status 1:
command: /tmp/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-d9a65xj8/vminute/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-d9a65xj8/vminute/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-wheel-d9a65xj8/vminute/pip-egg-info
cwd: /tmp/pip-wheel-d9a65xj8/vminute/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-wheel-d9a65xj8/vminute/setup.py", line 12, in <module>
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
File "/usr/lib/python3.8/codecs.py", line 905, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-wheel-d9a65xj8/vminute/requirements.txt'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Currently we have the following method for creating FQDN from the IP.
def get_FQDN_from_IP(ip):
# If we want to support old version of OpenStack, we have to update this function and
# solve it via serviceman
return "ci-vm-{0}-{1}-{2}-{3}.hosted.upshift.rdu2.redhat.com".format(*ip.split("."))
I really think that there should be any other way doing this.
I am thinking of config file containing some entry like:
FQDN=ci-vm-{0}-{1}-{2}-{3}.hosted.upshift.rdu2.redhat.com
It wants me to create ~/.5minute/config
but then it tries to read ~/.5minute/config.new
A proof:
# 5minute key ~/.ssh/id_rsa.pub
/bin/sh: /home/lpramuk/.5minute/config.new: No such file or directory
The configuration file ~/.5minute/config or ~/.5minute/local.conf does not exist.
Please download the OpenStack RC file from OpenStack WebUI (Access & Security > API Access > Download OpenStack RC file) and save it to ~/.5minute/config, or create and edit ~/.5minute/local.conf.
https://github.com/SatelliteQE/5minute/blob/master/vminute/vminute.py#L1112
the __setup_userdata_script
only accepts external URL paths to scripts to be executed by cloud init
.
It would be good to also add an implicit option to include script from the instances local path (e.g. /usr/5minute.sh
). This would be optional so it won't fail if such file doesn't exist.
The scripts might be parametrized by env variables:
example:
chmod +x /usr/5minute.sh
HOSTNAME="foo.bar" /usr/5minute.sh
The motivation is to be able to provide a static cinit script at the image creation time, so the URL with the script does not need to be available everytime when someone wishes to create a new instance from the image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.