Commit eee21d6f authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

slaprunner: mark as deprecated and python2 only

slaprunner is actually not working in python3 (see
slapos.toolbox!103)
and is currently unmaintained.
parent 4b28ab13
......@@ -351,7 +351,6 @@ tests =
# here, to check there's no promise issue when slapos node runs with Python 2.
fluentd ${slapos.test.fluentd-setup:setup}
kvm ${slapos.test.kvm-setup:setup}
slaprunner ${slapos.test.slaprunner-setup:setup}
metabase ${slapos.test.metabase-setup:setup}
erp5 ${slapos.test.erp5-setup:setup}
###
......@@ -379,6 +378,7 @@ extra =
html5as ${slapos.test.html5as-setup:setup}
html5as-base ${slapos.test.html5as-base-setup:setup}
beremiz-ide ${slapos.test.beremiz-ide-setup:setup}
slaprunner ${slapos.test.slaprunner-setup:setup}
[versions]
# slapos.core is used from the clone always
......
......@@ -7,153 +7,7 @@ Introduction
This software release is used to deploy Slaprunner instances.
Slaprunner is an all-in-one IDE used to develop and test profiles and recipes for SlapOS.
You can learn how to use it here :
http://community.slapos.org/wiki/slapos-Wiki.Home/developer-Lecture.Web.Runner.Extended
This software is only running in Python2 and has been deprecated in favor of theia.
See https://lab.nexedi.com/nexedi/slapos/tree/master/software/theia
Development
-----------
Here is an exemple of parameter XML to develop the slaprunner into another slaprunner :
<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="runner-importer-sshd-port">22224</parameter>
<parameter id="runner-sshd-port">22223</parameter>
<parameter id="no-ipv4-frontend">true</parameter>
</instance>
Parameters
----------
user-authorized-key
~~~~~~~~~~~~~~
You need to specify your SSH public key in order to connect to the SSH server of this instance.
Example of parameter XML::
<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="user-authorized-key">ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdNp7qZMVAzNc07opHshiIFDmJpYXQpetfcSgUj39a409d42PpsJElp7WsAE/x0nN6gUIoWIl7UiAlMzf6bKEJGJVSOZEPTmiJVlgK1Gp+kE0x9yNcncYg7p38Jny0daVA/NkkpAFyRsAm5kLGzyLtaCcktSvy0cJuy7WSSHU05pd1f8Y8thofE9g5t+/JA2VZvipxPkRfkFAG3aOAGLULlTImTSDFSDFGSDFG5F6mMnl7yvY2d6vEHVBu+K+aKmAwZVfCUwtSpa/tq3i2Lppjrw3UfrxbQSFHZCkzefr+u+l4YYe+tJrX7rYJYXD7LIfZfdSeFTlHFaN/yI1 user@host.local</parameter>
</instance>
instance-amount
~~~~~~~~~~~~~~~
Optional parameter.
Default: 10
Public-directory
----------------
You can serve static files with the webrunner. For that, just put your data in "srv/runner/public". All these files will be served throught the url of the webrunner + "/public/". Useful for developping your own static website.
AUTO-DEPLOYMENT
---------------
for software
~~~~~~~~~~~~
You can automatically deploy a software release while deploying the webrunner itself, using the paramater XML.
To do this, you only need to pass as a parameter named "slapos-software" : "AAA/BBB", where AAA is the folder of slapos.git where is located your BBB software.
For example, to deploy the hello-world software, you need to pass : software/helloworld
This is possible because the slapos.git is automatically downloaded when the webrunner is deployed.
It is also possible to download you own git repository, by providing the url in the "slapos-repository" parameter.
Last but not least, it is also possible to switch the branch with the parameter "slapos-reference" (by default pointing on master)
for instance
~~~~~~~~~~~~
The parameter "auto-deploy-instance" can be explicitly set to allow or prevent the runner to deploy the instance at START TIME (if you manually restart the runner, or if the server reboots). Values : "true" or "false". Default value is "true", except for the instances of import (while type is resilient or test) which is "false"
There also exists the parameter "autorun", which will build&run your software if set to true. For this, you need "auto_deploy" to true, and set the parameter "slapos-software" to the software you want to deploy. Do not hesitate to clone a different repo than "slapos", or to change the tag/branch to use your custom Software Release. (see "slapos-repository" and "slapos-reference" in previous section).
To deploy the instance with some parameters, just give to the runner parameters starting with "parameter-", they will be correctly forwarded to the instance, which will use them for its configuration. For example, if you want to send to the sofware helloworld the parameter "name" with the value "nicolas", here is how to configure the parameter.xml of the webrunner for auto-depolyment :
<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="slapos-software">software/helloworld</parameter>
<parameter id="auto_deploy">true</parameter>
<parameter id="autorun">true</parameter>
<parameter id="parameter-name">nicolas</parameter>
</instance>
Resilience :
------------
To order a resilient runner, you have to request a runner with the option: "--type resilient"
You can then decide on which node you want to deploy each instance, with the parameters.xml :
<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="-sla-runner2-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-pbs2-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-pbs1-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-runner1-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-runner0-computer_guid">COMP-XXXX</parameter>
</instance>
If you want to check by yourself that the pull-backup instances do their job, you can change directory to the slappart of runner0, and run ./bin/exporter (after creating your account, using the given backend_url or url): it would fill ./srv/backup/runner with data. If you then go to an import instance (runner1 or runner2) on the port 50005, you should be able to sign in the runner.
Tips :
~~~~~
To find in which partition the instance has been deployed, you can open the page of this specific instance, and look for "slappartXX" on the page.
Tests :
-------
To test the runner, start by ordering a runner with default type. Then READ the important note below :
/!\ IMPORTANT NOTE ON THE TESTS /!\ : in order to make them work, you have to comment the last line of the file __init__.py in the runner module (which is just : "run()"). Indeed, this line is used to load the config, when importing this module throught Gunicorn (the wsgi server). But the test suite loads itself the configuration, in fonction of the tested scenarios, etc... (You can find the module in the SR folder directory, under ./eggs/slapos.toolbox, or under parts/slapos.toolbox if you have a development version)
Then, su in the concerned slapuserX and run "./bin/runTestSuite".
For the tests on the resiliency of the webrunner, please refer to the README in slapos.toolbox.git/slapos/resiliencytest
Request custom frontend :
-------------------------
While deploying a server in your instance, you may need to ask for a custom ipv4 frontend.
The way to do that is to send a new parameter to your runner instance, using the parameters XML. The name of it is "custom-frontend-backend-url".
To create the frontend, you now have to wait the slaprunner to be processed.
You can define the type of your backend using "custom-frontend-backend-type". eg: zope
If you deploy a server, which uses basic auth, you also have to declare the parameter "custom-frontend-basic-auth" as true, or your slaprunner instance won't show as correctly instantiated.
Example :
<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="custom-frontend-backend-url">http(s)://[THE_IPV6_ADDRESS]:PORT</parameter>
<parameter id="custom-frontend-backend-type">zope</parameter>
<parameter id="custom-frontend-basic-auth">true</parameter>
</instance>
Things to notice for the nex developer :
----------------------------------------
As you can see in instance-runner-*.cfg, the buildout section extends a hard-coded template file. If one day you need to modify the filename, do not forget to modify it in instance.cfg, but also in these files ! (the problem is that the content of instance.cfg is not known by buildout while the deployment of the software release)
List of ports used by the webrunner:
------------------------------------
8602 : slapproxy, while running tests
9684 : apache (monitoring of slaprunner, git access)
22222 : dropbear
39986 : supervisord
50000 : slapproxy
50005 : webrunner (flask app), webdav access
Tips:
-----
You can use shellinabox in fullscreen, by accessing : https://[IPV6]:50005/shellinabox/
[buildout]
extends =
software.cfg
[python]
part = python3
[python-with-eggs]
eggs -=
# futures is a backport of Py3's concurrent.futures module
futures
......@@ -46,12 +46,9 @@ from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
from slapos.util import bytes2str
skipIfPython3 = unittest.skipIf(six.PY3, 'rdiff-backup is not compatible with Python 3 yet')
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..',
'software%s.cfg' % ("-py3" if six.PY3 else ""))))
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class SlaprunnerTestCase(SlapOSInstanceTestCase):
# Slaprunner uses unix sockets, so it needs short paths.
......@@ -499,7 +496,6 @@ class TestCustomFrontend(SlaprunnerTestCase):
parameter_dict['custom-frontend-url'],
'https://www.erp5.com')
@skipIfPython3
class TestResilientInstance(SlaprunnerTestCase):
instance_max_retry = 20
......@@ -526,14 +522,12 @@ class TestResilientInstance(SlaprunnerTestCase):
'url',
'webdav-url']))
@skipIfPython3
class TestResilientCustomFrontend(TestCustomFrontend):
instance_max_retry = 20
@classmethod
def getInstanceSoftwareType(cls):
return 'resilient'
@skipIfPython3
class TestResilientWebInstance(TestWeb):
instance_max_retry = 20
@classmethod
......@@ -544,7 +538,6 @@ class TestResilientWebInstance(TestWeb):
pass # Disable until we can write on runner0 rather them
# on root partition
@skipIfPython3
class TestResilientWebrunnerBasicUsage(TestWebRunnerBasicUsage):
instance_max_retry = 20
@classmethod
......@@ -552,14 +545,12 @@ class TestResilientWebrunnerBasicUsage(TestWebRunnerBasicUsage):
return 'resilient'
@skipIfPython3
class TestResilientWebrunnerAutorun(TestWebRunnerAutorun):
instance_max_retry = 20
@classmethod
def getInstanceSoftwareType(cls):
return 'resilient'
@skipIfPython3
class TestResilientDummyInstance(SlaprunnerTestCase):
instance_max_retry = 20
@classmethod
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment