Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
2a3fc196
Commit
2a3fc196
authored
Dec 01, 2022
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: add Remote Node portal type
It will be used to create cross master allocation
parent
8906c53c
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
242 additions
and
6 deletions
+242
-6
master/bt5/slapos_cloud/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
...eAllowedContentTypeTemplateItem/allowed_content_types.xml
+4
-0
master/bt5/slapos_cloud/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
...PortalTypeBaseCategoryTemplateItem/base_category_list.xml
+3
-0
master/bt5/slapos_cloud/PortalTypeHiddenContentTypeTemplateItem/hidden_content_type_list.xml
...iddenContentTypeTemplateItem/hidden_content_type_list.xml
+3
-0
master/bt5/slapos_cloud/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+6
-0
master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Remote%20Node.xml
...oud/PortalTypeTemplateItem/portal_types/Remote%20Node.xml
+70
-0
master/bt5/slapos_cloud/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+4
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
...ateItem/portal_skins/slapos_cloud/Person_findPartition.py
+5
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/RemoteNode_init.py
...TemplateItem/portal_skins/slapos_cloud/RemoteNode_init.py
+7
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/RemoteNode_init.xml
...emplateItem/portal_skins/slapos_cloud/RemoteNode_init.xml
+62
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+50
-0
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_allocatePartition.py
...ce_workflow/script_RequestedInstance_allocatePartition.py
+4
-4
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_allocatePartition.xml
...e_workflow/script_RequestedInstance_allocatePartition.xml
+6
-0
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/script_SoftwareInstallation_reindexComputeNode.py
...orkflow/script_SoftwareInstallation_reindexComputeNode.py
+1
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/script_SoftwareInstallation_reindexComputeNode.xml
...rkflow/script_SoftwareInstallation_reindexComputeNode.xml
+6
-0
master/bt5/slapos_cloud/bt/template_portal_type_allowed_content_type_list
...s_cloud/bt/template_portal_type_allowed_content_type_list
+2
-0
master/bt5/slapos_cloud/bt/template_portal_type_base_category_list
...5/slapos_cloud/bt/template_portal_type_base_category_list
+1
-0
master/bt5/slapos_cloud/bt/template_portal_type_hidden_content_type_list
...os_cloud/bt/template_portal_type_hidden_content_type_list
+2
-1
master/bt5/slapos_cloud/bt/template_portal_type_id_list
master/bt5/slapos_cloud/bt/template_portal_type_id_list
+1
-0
master/bt5/slapos_cloud/bt/template_portal_type_property_sheet_list
.../slapos_cloud/bt/template_portal_type_property_sheet_list
+4
-0
master/bt5/slapos_cloud/bt/template_portal_type_workflow_chain_list
.../slapos_cloud/bt/template_portal_type_workflow_chain_list
+1
-0
No files found.
master/bt5/slapos_cloud/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
View file @
2a3fc196
...
...
@@ -14,6 +14,7 @@
</portal_type>
<portal_type
id=
"Compute Node Module"
>
<item>
Instance Node
</item>
<item>
Remote Node
</item>
</portal_type>
<portal_type
id=
"Hosting Subscription Module"
>
<item>
Hosting Subscription
</item>
...
...
@@ -21,6 +22,9 @@
<portal_type
id=
"Instance Tree Module"
>
<item>
Instance Tree
</item>
</portal_type>
<portal_type
id=
"Remote Node"
>
<item>
Compute Partition
</item>
</portal_type>
<portal_type
id=
"Software Installation Module"
>
<item>
Software Installation
</item>
</portal_type>
...
...
master/bt5/slapos_cloud/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
View file @
2a3fc196
...
...
@@ -26,6 +26,9 @@
<portal_type
id=
"Instance Tree Module"
>
<item>
business_application
</item>
</portal_type>
<portal_type
id=
"Remote Node"
>
<item>
specialise
</item>
</portal_type>
<portal_type
id=
"Slave Instance"
>
<item>
aggregate
</item>
<item>
specialise
</item>
...
...
master/bt5/slapos_cloud/PortalTypeHiddenContentTypeTemplateItem/hidden_content_type_list.xml
View file @
2a3fc196
...
...
@@ -5,4 +5,7 @@
<portal_type
id=
"Hosting Subscription Module"
>
<item>
Hosting Subscription
</item>
</portal_type>
<portal_type
id=
"Remote Node"
>
<item>
Compute Partition
</item>
</portal_type>
</hidden_content_type_list>
\ No newline at end of file
master/bt5/slapos_cloud/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
2a3fc196
...
...
@@ -69,6 +69,12 @@
<portal_type
id=
"Person"
>
<item>
SlaposPersonConstraint
</item>
</portal_type>
<portal_type
id=
"Remote Node"
>
<item>
Computer
</item>
<item>
SlapOSReferenceConstraint
</item>
<item>
SlapOSVirtualMasterConstraint
</item>
<item>
SlaposComputeNodeConstraint
</item>
</portal_type>
<portal_type
id=
"Slave Instance"
>
<item>
InstanceTree
</item>
<item>
Reference
</item>
...
...
master/bt5/slapos_cloud/PortalTypeTemplateItem/portal_types/Remote%20Node.xml
0 → 100644
View file @
2a3fc196
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Base Type"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
content_icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
factory
</string>
</key>
<value>
<string>
addXMLObject
</string>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<tuple>
<string>
item
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Remote Node
</string>
</value>
</item>
<item>
<key>
<string>
init_script
</string>
</key>
<value>
<string>
RemoteNode_init
</string>
</value>
</item>
<item>
<key>
<string>
permission
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Base Type
</string>
</value>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
Item
</string>
</value>
</item>
<item>
<key>
<string>
type_interface
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
type_mixin
</string>
</key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
2a3fc196
...
...
@@ -47,6 +47,10 @@
<type>
Project
</type>
<workflow>
project_slap_interface_workflow
</workflow>
</chain>
<chain>
<type>
Remote Node
</type>
<workflow>
compute_node_slap_interface_workflow
</workflow>
</chain>
<chain>
<type>
Slave Instance
</type>
<workflow>
edit_workflow, instance_slap_interface_workflow, item_workflow, slapos_cloud_interaction_workflow
</workflow>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Person_findPartition.py
View file @
2a3fc196
...
...
@@ -76,6 +76,10 @@ for compute_node_list, is_slave_on_same_instance_tree_allocable in compute_node_
shared_partition
=
shared_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
)
if
shared_partition
is
not
None
:
partition_uid_list
.
append
(
shared_partition
.
getUid
())
elif
compute_node
.
getPortalType
()
==
'Remote Node'
:
parent_uid_list
.
append
(
compute_node
.
getUid
())
else
:
raise
NotImplementedError
(
'Unsupported Node type: %s'
%
compute_node
.
getPortalType
())
...
...
@@ -179,6 +183,7 @@ else:
for
compute_partition_candidate
in
portal
.
portal_catalog
(
limit
=
limit
,
**
query_kw
):
compute_partition_candidate
=
compute_partition_candidate
.
getObject
()
if
compute_partition_candidate
.
getParentValue
().
getCapacityScope
()
==
"close"
:
# The compute_node was closed on this partition, so skip it.
continue
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/RemoteNode_init.py
0 → 100644
View file @
2a3fc196
portal
=
context
.
getPortalObject
()
reference
=
"REMOTE-%s"
%
portal
.
portal_ids
.
generateNewId
(
id_group
=
'slap_instance_node_reference'
,
id_generator
=
'uid'
,
default
=
1
)
context
.
edit
(
reference
=
reference
)
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/RemoteNode_init.xml
0 → 100644
View file @
2a3fc196
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
RemoteNode_init
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
2a3fc196
...
...
@@ -477,6 +477,56 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type
=
'Internet Protocol Address'
)],
connection_dict
.
values
())
def
checkRemoteInstanceAllocation
(
self
,
person_user_id
,
person_reference
,
instance_title
,
software_release
,
software_type
,
server
,
project_reference
):
self
.
login
(
person_user_id
)
self
.
personRequestInstanceNotReady
(
software_release
=
software_release
,
software_type
=
software_type
,
partition_reference
=
instance_title
,
project_reference
=
project_reference
)
self
.
checkCloudContract
(
person_user_id
,
person_reference
,
instance_title
,
software_release
,
software_type
,
server
)
self
.
stepCallSlaposAllocateInstanceAlarm
()
self
.
tic
()
self
.
personRequestInstance
(
software_release
=
software_release
,
software_type
=
software_type
,
partition_reference
=
instance_title
,
project_reference
=
project_reference
)
# now instantiate it on compute_node and set some nice connection dict
# XXX XXX self.simulateSlapgridCP(server)
# let's find instances of user and check connection strings
instance_tree_list
=
[
q
.
getObject
()
for
q
in
self
.
_getCurrentInstanceTreeList
()
if
q
.
getTitle
()
==
instance_title
]
self
.
assertEqual
(
1
,
len
(
instance_tree_list
))
instance_tree
=
instance_tree_list
[
0
]
software_instance
=
instance_tree
.
getSuccessorValue
()
self
.
assertEqual
(
software_instance
.
getTitle
(),
instance_tree
.
getTitle
())
connection_dict
=
software_instance
.
getConnectionXmlAsDict
()
self
.
assertSameSet
((),
connection_dict
.
keys
())
"""
self.assertSameSet(('url_1', 'url_2'), connection_dict.keys())
self.login()
partition = software_instance.getAggregateValue()
self.assertSameSet(
['http://%s/' % q.getIpAddress() for q in
partition.contentValues(portal_type='Internet Protocol Address')],
connection_dict.values())"""
def
checkSlaveInstanceUnallocation
(
self
,
person_user_id
,
person_reference
,
instance_title
,
software_release
,
software_type
,
server
,
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_allocatePartition.py
View file @
2a3fc196
...
...
@@ -18,7 +18,7 @@ assert compute_partition.getPortalType() == "Compute Partition"
instance
.
edit
(
aggregate_value
=
compute_partition
,
activate_kw
=
{
'tag'
:
'allocate_%s'
%
compute_partition_url
})
compute_node
=
compute_partition
.
getParentValue
()
compute_node
.
ComputeNode_checkAndUpdateCapacityScope
(
allocated_instance
=
instance
)
if
compute_node
.
getPortalType
()
==
'Compute Node'
:
compute_node
.
ComputeNode_checkAndUpdateCapacityScope
(
allocated_instance
=
instance
)
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequestedInstance_allocatePartition.xml
View file @
2a3fc196
...
...
@@ -52,6 +52,12 @@
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_RequestedInstance_allocatePartition
</string>
</value>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/script_SoftwareInstallation_reindexComputeNode.py
View file @
2a3fc196
installation
=
state_change
[
'object'
]
compute_node
=
installation
.
getAggregateValue
(
portal_type
=
"Compute Node"
)
compute_node
=
installation
.
getAggregateValue
(
portal_type
=
[
"Remote Node"
,
"Compute Node"
]
)
if
compute_node
is
not
None
:
compute_node
.
activate
(
after_path_and_method_id
=
(
installation
.
getPath
(),
(
'immediateReindexObject'
,
'recursiveImmediateReindexObject'
))).
reindexObject
()
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/script_SoftwareInstallation_reindexComputeNode.xml
View file @
2a3fc196
...
...
@@ -60,6 +60,12 @@
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_SoftwareInstallation_reindexComputeNode
</string>
</value>
...
...
master/bt5/slapos_cloud/bt/template_portal_type_allowed_content_type_list
View file @
2a3fc196
...
...
@@ -2,10 +2,12 @@ Allocation Supply Line | Allocation Supply Cell
Allocation Supply Module | Allocation Supply
Allocation Supply | Allocation Supply Line
Compute Node Module | Instance Node
Compute Node Module | Remote Node
Compute Node | Certificate Login
Compute Node | ERP5 Login
Hosting Subscription Module | Hosting Subscription
Instance Tree Module | Instance Tree
Remote Node | Compute Partition
Software Installation Module | Software Installation
Software Instance Module | Slave Instance
Software Instance Module | Software Instance
...
...
master/bt5/slapos_cloud/bt/template_portal_type_base_category_list
View file @
2a3fc196
...
...
@@ -7,6 +7,7 @@ Hosting Subscription Module | business_application
Instance Node | specialise
Instance Tree Module | business_application
Instance Tree | destination_section
Remote Node | specialise
Slave Instance | aggregate
Slave Instance | specialise
Software Installation Module | business_application
...
...
master/bt5/slapos_cloud/bt/template_portal_type_hidden_content_type_list
View file @
2a3fc196
Allocation Supply Line | Allocation Supply Cell
Hosting Subscription Module | Hosting Subscription
\ No newline at end of file
Hosting Subscription Module | Hosting Subscription
Remote Node | Compute Partition
\ No newline at end of file
master/bt5/slapos_cloud/bt/template_portal_type_id_list
View file @
2a3fc196
...
...
@@ -7,6 +7,7 @@ Hosting Subscription Module
Instance Node
Instance Tree
Instance Tree Module
Remote Node
Slave Instance
Software Installation
Software Installation Module
...
...
master/bt5/slapos_cloud/bt/template_portal_type_property_sheet_list
View file @
2a3fc196
...
...
@@ -36,6 +36,10 @@ Instance Tree | TextDocument
Instance Tree | Url
Instance Tree | VariationRange
Person | SlaposPersonConstraint
Remote Node | Computer
Remote Node | SlapOSReferenceConstraint
Remote Node | SlapOSVirtualMasterConstraint
Remote Node | SlaposComputeNodeConstraint
Slave Instance | InstanceTree
Slave Instance | Reference
Slave Instance | SlapOSReferenceConstraint
...
...
master/bt5/slapos_cloud/bt/template_portal_type_workflow_chain_list
View file @
2a3fc196
...
...
@@ -18,6 +18,7 @@ Instance Tree | instance_tree_workflow
Organisation | organisation_slap_interface_workflow
Person | person_slap_interface_workflow
Project | project_slap_interface_workflow
Remote Node | compute_node_slap_interface_workflow
Slave Instance | edit_workflow
Slave Instance | instance_slap_interface_workflow
Slave Instance | item_workflow
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment