An error occurred fetching the project authors.
- 22 Apr, 2021 1 commit
-
-
Xavier Thompson authored
Add the minimum hateoas support required for the cli commands: - `slapos service list` - `slapos service info <reference>` - `slapos computer list` - `slapos computer info <reference>` To enable hateoas, complete the slapos.cfg configuration with: ``` [slapos] master_rest_url = <proxyaddr>/hateoas ``` Also: Fix some bugs and python3 incompatibilities in slap/hateoas.py. See merge request nexedi/slapos.core!290
-
- 22 Feb, 2021 1 commit
-
-
Xavier Thompson authored
When slapproxy forwards a request to an external master it is seen as coming from the slapproxy and the original requester's id is lost. This means forwarded requests from different requesters can collide. e.g. two partitions request a frontend and when the second request is handled the external master updates the first frontend to redirect to the second partition instead of creating a second frontend. To avoid collisions, the id of the requester as seen in the slapproxy is prefixed to the instance name (partition reference) in the request: - case 1: requester is embedded partition => prefix with partition id e.g. 'myinstance' -> 'slappart0_myinstance' - case 2: requester is user => prefix with 'user' e.g. 'myinstance' -> 'user_myinstance' See merge request nexedi/slapos.core!282
-
- 08 Oct, 2020 1 commit
-
-
Jérome Perrin authored
So far implementation of slapos proxy was incomplete regarding partition destructions: A partition requested as destroyed was properly destroyed "physically", files were removed from filesystem, services were removed from supervisor, but the partition was still marked as busy in proxy database, so it was never re-used in subsequent requests. To solve this, implement the destroyedComputerPartition endpoint to mark the partition as free. This is straightworfard for root partitions, but the cases of child partitions was a bit more tricky, especially because software releases usually does not implement properly the chain of deletion (it seems this is not properly implemted with softwaretype, only with switch_softwaretype) and generally because we don't want to leave orpheans partitions. In the case of ERP5 implementation of SlapOS master we have an alarm which garbage collect in these cases, so we implement something to reach similar goals. We refuse freeing a partition while their child paritions are not freed - and we request deletion of these partitions so that they are deleted on next slapos node report run. Then after a few runs, the whole partition tree will be completely destroyed and freed, even for software which does not implement deletion properly.
-
- 15 Sep, 2020 1 commit
-
-
Jérome Perrin authored
This way, we can call methods interacting with master on the returned partitions
-
- 11 May, 2020 2 commits
-
-
Jérome Perrin authored
In SlapOS, both users or partitions can requests partitions. With the multimaster support of slapos proxy, all requests where made as a user, but in the case of recursive slapos - where a partition from the "outer" slapos includes an "inner" slapos, it makes sense to forward partitions requests as the partition in the "outer" slapos - this way when this partition is destroyed all partitions that might have been requested are also destroyed. To request as partition, the multi-master entry must define two extra keys: - computer, that can be optained by $${slap-configuration:computer} from instance buildout - partition, that can be optained by $${slap-configuration:partition} When these are not set, the request will be made as a user, like it was the case before. We also change the test to unset SLAPGRID_INSTANCE_ROOT because this implementation has side effect - the environment variable is set and never unset. Without this, test fail when running the full test suite because a previous test was leaking SLAPGRID_INSTANCE_ROOT. This is definitely something we'll have to improve later.
-
Jérome Perrin authored
Eventhough implementation might be a bit more efficient is we use the low level API, we probably don't need performance here and it's easier to use the request API
-
- 17 Jan, 2020 1 commit
-
-
Łukasz Nowak authored
/reviewed-on nexedi/slapos.core!179
-
- 15 Jan, 2020 1 commit
-
-
Łukasz Nowak authored
Each time slave partition changes (it is added or updated) the master partition timestamp has to be recalculated. /reviewed-on nexedi/slapos.core!176
-
- 25 Nov, 2019 2 commits
-
-
Nicolas Wavrant authored
Also renames it so it reflects well its function. Before the fix in 77c4cca0b3026fb6b35c13d2bb7cc1b43ae1da26, each call to /loadComputerConfigurationFromXML was deleting all the partition in the database. After the fix, because the test environment is not cleaned correctly between different tests, some slapparts would remain between following tests. Thanks to this commit, the previous behavior is restaured.
-
Jérome Perrin authored
-
- 26 Oct, 2019 1 commit
-
-
Rafael Monnerat authored
On the tests for ConsumptionReportBase, it contains a port from a test on slapos.toolbox done by Alain Takoudjou.
-
- 01 Oct, 2019 4 commits
-
-
Jérome Perrin authored
Calling computer.updateConfiguration should remove previously defined partitions that are no longer part of the configuration.
-
Jérome Perrin authored
Similar to the way we bypass for simple frontends. This should allow kvm software promises to pass.
-
Jérome Perrin authored
When slapproxy is not using multi-master, shared frontend requests were never fulfilled. This is problematic because several promises (for example monitor ones) assert that frontend is instanciated and properly responding to HTTP requests. Better-than-nothing approach is to return the URL provided as input, ie: "Give me a frontend for $URL" -> "OK, just use $URL".
-
Jérome Perrin authored
(because it looks strange)
-
- 01 Aug, 2019 2 commits
-
-
Julien Muchembled authored
-
Julien Muchembled authored
-
- 22 Mar, 2019 3 commits
-
-
Jérome Perrin authored
Because we want to trigger an upgrade that will remove old tables. Note that re-dumping database_dump_version_current fixed the column order in software table - the dump was incorrect (this also change output of `proxy show` for this test)
-
Jérome Perrin authored
Create a test for each previous versions to current version (starting from version 10, earlier versions are not really supported). Procedure to add test for new version can be: * update table structure and increase version in slapos/proxy/schema.sql * use generate_dump.sh script to generate slapos/tests/test_slapproxy/database_dump_version_$NEW_VERSION.sql from slapos/tests/test_slapproxy/database_dump_version_$PREVIOUS_VERSION.sql (with computer_id "computer") * add TestMigrateVersion$(NEW_VERSION)ToLatest in slapos/tests/test_slapproxy/__init__.py * use generate_dump.sh script to update in-place slapos/tests/test_slapproxy/database_dump_version_current.sql (with computer_id "slaprunner")
-
Jérome Perrin authored
Instead of keeping old tables which cause confusion for humans and tools directly operating on the database, remove old tables and create a separate backup file.
-
- 19 Mar, 2019 2 commits
-
-
Jérome Perrin authored
This test was probably asserting that initial state was OK
-
Jérome Perrin authored
-
- 18 Feb, 2019 1 commit
-
-
Łukasz Nowak authored
/reviewed-on nexedi/slapos.core!99
-
- 31 Jan, 2019 1 commit
-
-
Jérome Perrin authored
- rename test files as test_*.py, this is how tests are collected by py.test - take into account that test runner might disable log level and patch sys.stdout already /reviewed-on nexedi/slapos.core!92
-
- 28 Dec, 2018 1 commit
-
-
Jérome Perrin authored
They will be closed in __del__, probably soon enough, but it's cleaner to close explicity. This also stops the ResourceWarning on python3
-
- 27 Dec, 2018 1 commit
-
-
Jérome Perrin authored
Tests are sometimes failing with: ``` ====================================================================== FAIL: testForwardToMasterInList (slapos.tests.slapproxy.TestMultiMasterSupport) ---------------------------------------------------------------------- Traceback (most recent call last): File "/srv/slapgrid/slappart9/srv/testnode/byq/inst/test0-0/parts/slapos.core/slapos/tests/slapproxy/__init__.py", line 1003, in setUp self.startExternalProxy() File "/srv/slapgrid/slappart9/srv/testnode/byq/inst/test0-0/parts/slapos.core/slapos/tests/slapproxy/__init__.py", line 1050, in startExternalProxy self.fail('Could not start external proxy.') AssertionError: Could not start external proxy. ``` especially on `COMP-2203-3Nodes-ERP5PROJECT2`. I logged on that machine and check the tests, it was really a problem that this slapproxy needs more than the `(20 * .1) = 2` seconds this tests waits before concluding that slap proxy could not start. Change the waiting loop to wait more each time. With this approach the max waiting time is 20 seconds. /reviewed-on !83
-
- 26 Dec, 2018 1 commit
-
-
Jérome Perrin authored
this XXX comment no longer apply
-
- 20 Dec, 2018 2 commits
-
-
Jérome Perrin authored
proxy was just removing the software from database when destruction was requested. Instead, keep it as requested_state = "destroyed" and return this information to the node, so that nodes properly destroy the software.
-
Jérome Perrin authored
-
- 17 Dec, 2018 1 commit
-
-
Jérome Perrin authored
to keep tests silent. On python2, this uses subprocess32, which backports DEVNULL (and default setting of closing file descriptors).
-
- 14 Dec, 2018 1 commit
-
-
Bryton Lacquement authored
-
- 08 Nov, 2018 1 commit
-
-
Thomas Gambier authored
assertEquals is deprecated, see https://docs.python.org/2.7/library/unittest.html#deprecated-aliases /reviewed-on nexedi/slapos.core!58
-
- 25 Oct, 2016 1 commit
-
-
Alain Takoudjou authored
-
- 29 Apr, 2016 1 commit
-
-
Rafael Monnerat authored
Several packages has same namespace, this prevents fail if several slapos related packages are installed on the same machine.
-
- 27 Apr, 2016 1 commit
-
-
Rafael Monnerat authored
-
- 15 Nov, 2015 2 commits
-
-
Kirill Smelkov authored
1. when forming instance parameters xml dict on client side, we cannot use str() to convert parameter_value to string - because it breaks e.g. this way: In [1]: s = u'Привет Мир!' In [2]: str(s) --------------------------------------------------------------------------- UnicodeEncodeError Traceback (most recent call UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) Fix is: convert arguments to unicode strings. 2. when decoding xml on server side it was erroneously assumed to be always unicode, and this way xml.encode('utf-8') fails if xml is str but with non-ascii characters: In [3]: r = 'hello world' In [4]: r.encode('utf-8') Out[4]: 'hello world' In [5]: t = s.encode('utf-8') In [6]: t Out[6]: '\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82 \xd0\x9c\xd0\xb8\xd1\x80!' In [7]: t.encode('utf-8') --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128) Fix is: don't assume xml string is unicode and decode it only, if it is unicode, and leave as it is if it is just str.
-
Kirill Smelkov authored
Currently it is just sqlite3.connect(), but we'll want to add connection autotuning in the next patch, so before that let's consolidate all sqlite opening places in the code into one.
-
- 16 Jul, 2015 1 commit
-
-
Jérome Perrin authored
-
- 05 Jan, 2015 1 commit
-
-
Jérome Perrin authored
-
- 18 Nov, 2014 1 commit
-
-
Cédric de Saint Martin authored
-