297 Commits

Author SHA1 Message Date
Takashi Kajinami
be9e28dc67 Add more informative debug logs to agent processes
This patch adds some more debug logs into agent processes, so that
we can observe their behavior more in detail.
Also, this patch removes some detailed informations like pids from
responses returned to gateway/runtime, because gateway/runtime doesn't
require the details of agent behavior.

Change-Id: I2fd9998966120c46414e607b94ce03bee884e11f
2020-09-06 20:03:25 +09:00
Takashi Kajinami
826be15b6a Use SBusClient for execute command
This patch is the final refactoring work to have client library
for sbus communication, and port current implementaion about
execute command from runtime to SBusClient.

This patch makes execute command rely on the same communication
as the other commands, which happens on SERVICE_OUT_FD, and remove
TASK_ID_OUT_FD which is used only for returning task id.
This allows us to avoid special handling for execute command.

Change-Id: I00dc7b3004512624f9aaf120420f910e451cac89
2020-04-13 16:54:01 +09:00
Takashi Kajinami
55d9c28253 Use Python 3 by default to run storlet applications
Use Python 3 to run storlet application when runtime version is not
specified.
Also fix py3 compatibility for some python storlet applications used
for functional tests.

Change-Id: Ic33bb339339e9ff446fd308663c692db834f2a81
2020-01-07 10:12:50 +09:00
Takashi Kajinami
f5815f065a Use the same python version to run storlet agents
This patch refactors package installations in storlets devstack
plugin, so that we can run storlets agents with the same python
version as the one we have in host to run storlets middleware.

This patch also bumps up openjdk version from 8 to 11, and python3
version from 3.5 to 3.6, so that we use the latest versin provided
in distro.

Change-Id: I6cb87976ff4fa6caaa58cf555685f24d95f214a8
2019-12-23 12:44:54 +09:00
Zuul
9d9cbb6068 Merge "PY3: Fix ipython extension as py3 compatible" 2019-11-29 23:13:02 +00:00
Zuul
d4d8ea5c73 Merge "Remove unused PUT path in test_half_storlet" 2019-11-29 08:46:06 +00:00
Kota Tsuyuzaki
1c22762ae1 PY3: Fix ipython extension as py3 compatible
Because python-swiftclient returns bytes response
body so the concat of the body iter should be defined
as bytes.

* bonus: remove unnecessary "hoge" print output

Change-Id: I0cd41055ba6c840b412d5f750ff2fc7e2c59f320
2019-11-28 11:24:19 +09:00
Zuul
583d126bb4 Merge "Avoid broken http header including white space" 2019-11-15 09:10:42 +00:00
Kota Tsuyuzaki
b4af2b12b6 Avoid broken http header including white space
The execution result header in user metadata looks invalid
and it cuases the hang in the func CI tessting.
So let's remove the dangerous white space in the http
header key with this patch.

The skip test removed in this patch has been since
https://review.opendev.org/#/c/693549 . The skipping
purpose was to progress py3 migration (we'd like to find
any other issues than this at the time) so the test is still
worth, then this fix enables to pass the test.

Change-Id: Ib41735d8801f0c99ed0563213dcf414fefb5cbb2
2019-11-15 07:43:42 +00:00
Tim Burke
26bb09343f Remove unused PUT path in test_half_storlet
Change-Id: I27f131c53b7cb6f98cb1470c918d583a98547789
2019-11-14 16:12:20 -08:00
Zuul
b94643a2f2 Merge "Make jupyter test notebook py2/3 compatible" 2019-11-14 05:58:35 +00:00
Zuul
b0c939fe24 Merge "Update test_deploy_storlet expectations to be bytes" 2019-11-13 02:45:05 +00:00
Zuul
bfbc327dd7 Merge "py3: Fix up some func tests" 2019-11-13 02:45:04 +00:00
Zuul
c3cb2c044d Merge "Clean up tmp file in more cases" 2019-11-13 01:08:02 +00:00
Tim Burke
ccef5d4dfe Update test_deploy_storlet expectations to be bytes
...since we didn't provide any encoding. Also, open files in binary mode
when hashing to compare against ETags.

Change-Id: Ie8ac1d1ff0216d945b1b1602c944cb62234a84a8
2019-11-12 14:17:49 -08:00
Zuul
ed131d9ba4 Merge "PY3: Fix datagram message to be bytes" 2019-11-11 03:04:50 +00:00
Tim Burke
2e5823f007 Clean up tmp file in more cases
Previously, if the test failed, we would not remove the file.

Change-Id: Icaa3f2894feab48279073ddb19e8586f0528763b
2019-11-09 02:02:41 +00:00
Tim Burke
01e3dfa92f py3: Fix up some func tests
Lots of str-needing-to-be-bytes fixes, mostly.

Seems to be an issue with tests around executing? Skipped the two that
would just hang, but test_deploy_storlet might be a good place to start
poking around.

Change-Id: I99a6beda9c3a8883d9f13a953cba13aa21d847bb
2019-11-08 23:04:31 +00:00
Tim Burke
9f2e9b20b8 Make jupyter test notebook py2/3 compatible
Change-Id: I2649728d5a240e0f476f71742f4e950b4c68e643
2019-11-08 14:39:21 +00:00
Kota Tsuyuzaki
236aaf2894 PY3: Fix datagram message to be bytes
And the reply should be str after it was received.

Change-Id: I69ebd60bda4e711b560b8cc7b3487988f69acafa
2019-11-08 06:33:59 +00:00
Zuul
a4087219c7 Merge "PY3: skip jupyter notebook test" 2019-11-08 06:10:39 +00:00
Kota Tsuyuzaki
8ec7ae5edc PY3: skip jupyter notebook test
because the notebook is strictly tightened to python2.
Re-writing the python2 notebook in python3 will cause
an error or a failure in python2 functional test, so
add skipTest check for now.

In the future, we could switch the available version
or have a couple of tests for both versions.

Change-Id: I9ec5cc107459266de509d3c444c5294f965dd749
2019-11-08 12:51:25 +09:00
Zuul
53ff2b7a84 Merge "Migrate detailed implementation from __init__.py" 2019-11-08 03:24:13 +00:00
Takashi Kajinami
dfbdd27bd8 Use smaller file for functional tests
1GB and 512MB are too large to test chunked read, and 10MB should
be enough.

Change-Id: Id91acedbc144913769d0b5ced6a6acfc3268d826
2019-11-08 11:11:10 +09:00
Takashi Kajinami
8e31cdc7ba Migrate detailed implementation from __init__.py
... as we don't expect long codes are included in __init__.py .
This patch migrates these implementations to new independent
files, with keeping alias so that we can import things with
the same path.

Change-Id: Iff0b60cd53281c999c930a4e789aaaab360b1c7a
2019-11-08 11:07:39 +09:00
Kota Tsuyuzaki
84421c93d0 PY3: Fix file open to read/write the data as bytes
Because swiftclient.put_object assumes it as bytes object.
Only ZipFile is not suppoting rb mode so leave it as it is.
It should be okay because Storlets use it just to pick up
the filnames that should be string instead of bytes.

Change-Id: I834b29886a18269de2745ffe584291491e80f9eb
2019-11-07 16:47:27 +00:00
Zuul
bf0dec8020 Merge "Enable unit tests related to internal_client" 2019-11-07 07:50:21 +00:00
Takashi Kajinami
12bc89be86 Enable unit tests related to internal_client
These tests are skipped because we use swift codes which weren't
compatible with Py2, but now we are ready to use them in Py3.

Change-Id: I717686c7d63bb0b21d25f534ba439e611ea2f5bc
2019-11-07 14:52:41 +09:00
Kota Tsuyuzaki
9eb84a2282 PY3: Fix urllib path to be compatible with py3
Change-Id: If6a41b27dcda4c556d9b0ca7da58b847dc606f5c
2019-11-01 17:56:29 +09:00
Takashi Kajinami
18b05fe4bd Merge file descriptors and their metadata into one class
This patch bundiles a file descriptor and its metadata
into one class named SBusFileDescriptor, so that we can
keep the relationship between them easily.

Change-Id: Ib042f2a7bd4bd524e9b4b8d155ec192edaaca7f0
2019-09-25 19:46:02 +09:00
Zuul
1ec8a7bc9c Merge "Create an independent directory to place jar libraries" 2019-09-25 04:57:05 +00:00
Zuul
e2965d6082 Merge "Normalize method names for RunTimePaths class" 2019-09-25 03:04:19 +00:00
Takashi Kajinami
4450bf1e23 Normalize method names for RunTimePaths class
This patch normalizes method name for RunTimePaths, according
to the following policy, so that it is more easy to understand
the characteristics of each method functions

 - Use @propery for the functions without any arguments
 - Use get_foo for the functions which take arguments
 - Use foo_dir for directory paths

This patch also fixes wrong path handling in storlet app log.

Change-Id: I9275a84a2881b29a91eb55efaa6bc5607f1e723c
2019-08-25 22:41:10 +09:00
Takashi Kajinami
e04818f234 Use json for response sent through service out fd
Now we use very simple format using ':' as a separator return
task status and a message related to the task operation, but
that protocol makes it difficult to add more informations into
the response.

This patch changes its format to json, so that we can include
more information keys/values into the response easily.

Change-Id: If2d609fb2ba2187e121e9cadd281017af46a6661
2019-08-09 19:38:08 +09:00
Zuul
905956ff81 Merge "Add basic client implementation for sbus protocol" 2019-08-08 01:32:30 +00:00
Takashi Kajinami
a21a14f13a Add basic client implementation for sbus protocol
This patch introduces basic implementation of the client to communicate
with remote process using sbus, to gather all codes which deeply depend
on the sbus protocol into the one place.

This patch also introduces sbus CLI, which enables operators to send
sbus command like halt easily.

Change-Id: Ie1721c016b10b6562b131eb39e3dc84b1d8d473f
2019-08-07 14:37:22 +09:00
Takashi Kajinami
d0194f66b2 Create an independent directory to place jar libraries
Previously we place all lib files under /usr/local/lib/storlets, but
this makes it more difficult to have lang specific files there.

This patch creates java directory where we place jar files, so that
we can place libraries for other languages like python in the future.

Change-Id: Id384c72ab6e658c55312ad62499dfc2100ba3ca3
2019-07-23 16:13:27 +09:00
Zuul
e6f7869974 Merge "Prevent undesired retry when starting container" 2019-07-03 06:41:34 +00:00
Takashi Kajinami
82a326408a Have language_version as a member of StorletRequest
StorletRequest is used to parse basic options for storlet
excecutions. This patch makes language_version also a mamber
of the class, which is currently handled outside it.

Change-Id: Id887fb0eaab528005a946013f9faf6ddca82bf42
2019-05-03 19:21:59 +09:00
Takashi Kajinami
25e7201203 Prevent undesired retry when starting container
Previously, if we fail to start a storlet container using tenant
image, we retry to start it using default tenant image. However,
that sometimes causes unexpected retry, for example when there is
something wrong in tenant image which prevents daemon factory to
launch in time.

This patch makes docker runtime to check return code of container
restarting script, so that we only restart container when the
runtime fails in container operation using tenant image.
In addition, it lets docker runtime to log stdout/stderr output
generated by restart_docker_container, to help us to debug what
is happening about container management.

Change-Id: Icd81d28b9b3555bce365e7b279ada074d239fddc
2019-05-02 16:26:51 +09:00
Kota Tsuyuzaki
1a7b0baba6 Support py3 execution environment
Change-Id: If14d17d74e57eaa1ebe04af9fdc8ef0423c3a989
2019-03-06 17:21:41 +09:00
lijunjie
6105e064f6 Fix the misspelling of "required"
Change-Id: I428b98e2c4258c69b03db99fff434202611086f3
2019-01-16 17:46:13 +08:00
zhulingjie
55052a2980 python 3 compatibility: fix xrange/range issues
xrange is not defined in python3.
Rename xrange() to range().

Change-Id: I6e2d934cee802fcd6fbca3d19c5d51a641fef018
2018-10-07 23:19:52 -04:00
Kota Tsuyuzaki
2fc038973b py3: make swift_middleware as py3 compatible
Change-Id: Ia1790e50e0029f31767b8eebe4985532e5885543
2018-07-25 08:53:08 +00:00
Kota Tsuyuzaki
d5a038f4ac Py3: Make storlets/agent as py3 compatible
Change-Id: I84d10daca3335f9d9ef0d1d475aae3b7406f6dbe
2018-07-24 18:22:28 +09:00
Kota Tsuyuzaki
4d2fd92d97 py3: make storlets tools as py3 compatible
Change-Id: I9d0c21c8e36c46a855f1bd4eedc0e1f1e21bf10e
2018-07-10 14:38:30 +09:00
Kota Tsuyuzaki
318032ebfd py3: make sbus datagram as py3 compatible
Change-Id: I403d4a5c3001d5062ef5200a45b586633cd899d9
2018-07-09 16:08:35 +09:00
Kota Tsuyuzaki
b7f9c346e1 Remove setup_functional_test.sh
That is just calling s2aio.sh for our functional gate but
just calling it at the playbook is easier so let's remove
the unnecessary bash shell.

Change-Id: Ic2820c681295e2e1b68bbf91d6fa70de266cdedc
2018-06-07 15:00:30 +09:00
chengebj5238
e8a34c2ae2 Amend the spelling error of a word
Change-Id: Id2eb5beac5db9771ca9e1c05db46ea6b622a661d
2018-06-07 09:04:03 +08:00
Zuul
ac7066003e Merge "Fix typos in storlets" 2018-04-12 10:23:35 +00:00