hybrid_platforms_conductor 32.13.0 → 32.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/docs/executables/check-node.md +1 -1
- data/docs/executables/deploy.md +1 -1
- data/docs/executables/free_ips.md +1 -1
- data/docs/executables/free_veids.md +1 -1
- data/docs/executables/get_impacted_nodes.md +1 -1
- data/docs/executables/last_deploys.md +1 -1
- data/docs/executables/nodes_to_deploy.md +1 -1
- data/docs/executables/report.md +1 -1
- data/docs/executables/run.md +1 -1
- data/docs/executables/setup.md +1 -1
- data/docs/executables/ssh_config.md +1 -1
- data/docs/executables/test.md +1 -1
- data/docs/tutorial.md +4 -0
- data/docs/tutorial/04_test.md +12 -2
- data/docs/tutorial/05_extend_with_plugins.md +3 -5
- data/examples/tutorial/01_installation/my-platforms/Gemfile +3 -0
- data/examples/tutorial/01_installation/my-platforms/hpc_config.rb +0 -0
- data/examples/tutorial/02_first_node/my-platforms/Gemfile +3 -0
- data/examples/tutorial/02_first_node/my-platforms/hpc_config.rb +1 -0
- data/examples/tutorial/02_first_node/my-service-conf-repo/inventory.yaml +13 -0
- data/examples/tutorial/02_first_node/my-service-conf-repo/my-service.conf.erb +3 -0
- data/examples/tutorial/02_first_node/my-service-conf-repo/service_my-service.rb +58 -0
- data/examples/tutorial/02_first_node/node/my-service.conf +4 -0
- data/examples/tutorial/03_scale/my-platforms/Gemfile +3 -0
- data/examples/tutorial/03_scale/my-platforms/hpc_config.rb +1 -0
- data/examples/tutorial/03_scale/my-platforms/my_commands.bash +2 -0
- data/examples/tutorial/03_scale/my-service-conf-repo/inventory.yaml +90 -0
- data/examples/tutorial/03_scale/my-service-conf-repo/my-service.conf.erb +3 -0
- data/examples/tutorial/03_scale/my-service-conf-repo/service_my-service.rb +58 -0
- data/examples/tutorial/03_scale/my-service-conf-repo/service_web-hello.rb +43 -0
- data/examples/tutorial/03_scale/node/my-service.conf +4 -0
- data/examples/tutorial/03_scale/web_docker_image/Dockerfile +33 -0
- data/examples/tutorial/03_scale/web_docker_image/hello_world.txt +1 -0
- data/examples/tutorial/03_scale/web_docker_image/hpc_root.key +27 -0
- data/examples/tutorial/03_scale/web_docker_image/hpc_root.key.pub +1 -0
- data/examples/tutorial/03_scale/web_docker_image/main.go +43 -0
- data/examples/tutorial/03_scale/web_docker_image/start.sh +7 -0
- data/examples/tutorial/03_scale/web_docker_image/test.bash +6 -0
- data/examples/tutorial/04_test/my-platforms/Gemfile +3 -0
- data/examples/tutorial/04_test/my-platforms/hpc_config.rb +12 -0
- data/examples/tutorial/04_test/my-platforms/images/debian_10/Dockerfile +13 -0
- data/examples/tutorial/04_test/my-platforms/my_commands.bash +2 -0
- data/examples/tutorial/04_test/my-service-conf-repo/inventory.yaml +100 -0
- data/examples/tutorial/04_test/my-service-conf-repo/my-service.conf.erb +3 -0
- data/examples/tutorial/04_test/my-service-conf-repo/service_my-service.rb +58 -0
- data/examples/tutorial/04_test/my-service-conf-repo/service_web-hello.rb +43 -0
- data/examples/tutorial/04_test/node/my-service.conf +4 -0
- data/examples/tutorial/04_test/web_docker_image/Dockerfile +33 -0
- data/examples/tutorial/04_test/web_docker_image/hello_world.txt +1 -0
- data/examples/tutorial/04_test/web_docker_image/hpc_root.key +27 -0
- data/examples/tutorial/04_test/web_docker_image/hpc_root.key.pub +1 -0
- data/examples/tutorial/04_test/web_docker_image/main.go +43 -0
- data/examples/tutorial/04_test/web_docker_image/start.sh +7 -0
- data/examples/tutorial/04_test/web_docker_image/test.bash +6 -0
- data/examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/hosts.json +12 -0
- data/examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-gcc.bash +14 -0
- data/examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-python.bash +14 -0
- data/examples/tutorial/05_extend_with_plugins/dev_docker_image/Dockerfile +20 -0
- data/examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key +27 -0
- data/examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key.pub +1 -0
- data/examples/tutorial/05_extend_with_plugins/my-platforms/Gemfile +4 -0
- data/examples/tutorial/05_extend_with_plugins/my-platforms/hpc_config.rb +13 -0
- data/examples/tutorial/05_extend_with_plugins/my-platforms/images/debian_10/Dockerfile +13 -0
- data/examples/tutorial/05_extend_with_plugins/my-platforms/my_commands.bash +2 -0
- data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/inventory.yaml +100 -0
- data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/my-service.conf.erb +3 -0
- data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_my-service.rb +58 -0
- data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_web-hello.rb +43 -0
- data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/platform_handler/json_bash.rb +115 -0
- data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/report/web_report.rb +52 -0
- data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/test/root_space.rb +44 -0
- data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/my_hpc_plugins.gemspec +15 -0
- data/examples/tutorial/05_extend_with_plugins/node/my-service.conf +4 -0
- data/examples/tutorial/05_extend_with_plugins/web_docker_image/Dockerfile +33 -0
- data/examples/tutorial/05_extend_with_plugins/web_docker_image/hello_world.txt +1 -0
- data/examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key +27 -0
- data/examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key.pub +1 -0
- data/examples/tutorial/05_extend_with_plugins/web_docker_image/main.go +43 -0
- data/examples/tutorial/05_extend_with_plugins/web_docker_image/start.sh +7 -0
- data/examples/tutorial/05_extend_with_plugins/web_docker_image/test.bash +6 -0
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/tools/generate_mermaid +1 -1
- metadata +131 -1
@@ -0,0 +1,115 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'hybrid_platforms_conductor/platform_handler'
|
3
|
+
|
4
|
+
module MyHpcPlugins
|
5
|
+
|
6
|
+
module HpcPlugins
|
7
|
+
|
8
|
+
module PlatformHandler
|
9
|
+
|
10
|
+
# A nice platform handler to handle platforms of our team, using json inventory and bash scripts.
|
11
|
+
class JsonBash < HybridPlatformsConductor::PlatformHandler
|
12
|
+
|
13
|
+
# Get the list of known nodes.
|
14
|
+
# [API] - This method is mandatory.
|
15
|
+
#
|
16
|
+
# Result::
|
17
|
+
# * Array<String>: List of node names
|
18
|
+
def known_nodes
|
19
|
+
# This method is used to get the list of nodes that are handled by the platform
|
20
|
+
# In our case we read our json file to get this information, and use just the first part of the hostname as the node's name.
|
21
|
+
JSON.parse(File.read("#{repository_path}/hosts.json")).keys.map { |hostname| hostname.split('.').first }
|
22
|
+
end
|
23
|
+
|
24
|
+
# Get the metadata of a given node.
|
25
|
+
# [API] - This method is mandatory.
|
26
|
+
#
|
27
|
+
# Parameters::
|
28
|
+
# * *node* (String): Node to read metadata from
|
29
|
+
# Result::
|
30
|
+
# * Hash<Symbol,Object>: The corresponding metadata
|
31
|
+
def metadata_for(node)
|
32
|
+
# All nodes handled by this platform are running a debian buster image and we derive their name from their hostname.
|
33
|
+
{
|
34
|
+
hostname: "#{node}.hpc_tutorial.org",
|
35
|
+
image: 'debian_10'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Return the services for a given node
|
40
|
+
# [API] - This method is mandatory.
|
41
|
+
#
|
42
|
+
# Parameters::
|
43
|
+
# * *node* (String): node to read configuration from
|
44
|
+
# Result::
|
45
|
+
# * Array<String>: The corresponding services
|
46
|
+
def services_for(node)
|
47
|
+
# This info is taken from our JSON inventory file
|
48
|
+
[JSON.parse(File.read("#{repository_path}/hosts.json"))["#{node}.hpc_tutorial.org"]]
|
49
|
+
end
|
50
|
+
|
51
|
+
# Get the list of services we can deploy
|
52
|
+
# [API] - This method is mandatory.
|
53
|
+
#
|
54
|
+
# Result::
|
55
|
+
# * Array<String>: The corresponding services
|
56
|
+
def deployable_services
|
57
|
+
# This info is taken by listing existing bash scripts
|
58
|
+
Dir.glob("#{repository_path}/install-*.bash").map { |file| File.basename(file).match(/install-(.*)\.bash/)[1] }
|
59
|
+
end
|
60
|
+
|
61
|
+
# Get the list of actions to perform to deploy on a given node.
|
62
|
+
# Those actions can be executed in parallel with other deployments on other nodes. They must be thread safe.
|
63
|
+
# [API] - This method is mandatory.
|
64
|
+
# [API] - @cmd_runner is accessible.
|
65
|
+
# [API] - @actions_executor is accessible.
|
66
|
+
#
|
67
|
+
# Parameters::
|
68
|
+
# * *node* (String): Node to deploy on
|
69
|
+
# * *service* (String): Service to be deployed
|
70
|
+
# * *use_why_run* (Boolean): Do we use a why-run mode? [default = true]
|
71
|
+
# Result::
|
72
|
+
# * Array< Hash<Symbol,Object> >: List of actions to be done
|
73
|
+
def actions_to_deploy_on(node, service, use_why_run: true)
|
74
|
+
# This method returns all the actions to execute to deploy on a node.
|
75
|
+
# The use_why_run switch is on if the deployment should just be simulated.
|
76
|
+
# Those actions (bash commands, scp of files, ruby code...) should be thread safe as they can be executed in parallel with other deployment actions for other nodes in case of a concurrent deployment on several nodes.
|
77
|
+
# In our case it's very simple: we just call our bash script on the node's hostname.
|
78
|
+
[{ bash: "#{repository_path}/install-#{service}.bash #{@nodes_handler.get_hostname_of(node)} #{use_why_run ? 'check' : ''}" }]
|
79
|
+
end
|
80
|
+
|
81
|
+
# Parse stdout and stderr of a given deploy run and get the list of tasks with their status
|
82
|
+
# [API] - This method is mandatory.
|
83
|
+
#
|
84
|
+
# Parameters::
|
85
|
+
# * *stdout* (String): stdout to be parsed
|
86
|
+
# * *stderr* (String): stderr to be parsed
|
87
|
+
# Result::
|
88
|
+
# * Array< Hash<Symbol,Object> >: List of task properties. The following properties should be returned, among free ones:
|
89
|
+
# * *name* (String): Task name
|
90
|
+
# * *status* (Symbol): Task status. Should be one of:
|
91
|
+
# * *:changed*: The task has been changed
|
92
|
+
# * *:identical*: The task has not been changed
|
93
|
+
# * *diffs* (String): Differences, if any
|
94
|
+
def parse_deploy_output(stdout, stderr)
|
95
|
+
# In our case our bash scripts return the last line as a status, so use it.
|
96
|
+
[{
|
97
|
+
name: 'Install tool',
|
98
|
+
status:
|
99
|
+
case stdout.split("\n").last
|
100
|
+
when 'OK'
|
101
|
+
:identical
|
102
|
+
else
|
103
|
+
:changed
|
104
|
+
end,
|
105
|
+
diffs: stdout
|
106
|
+
}]
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'hybrid_platforms_conductor/report'
|
2
|
+
|
3
|
+
module MyHpcPlugins
|
4
|
+
|
5
|
+
module HpcPlugins
|
6
|
+
|
7
|
+
module Report
|
8
|
+
|
9
|
+
# Publish reports to our web reporting tool
|
10
|
+
class WebReport < HybridPlatformsConductor::Report
|
11
|
+
|
12
|
+
# Give the list of supported locales by this report generator
|
13
|
+
# [API] - This method is mandatory.
|
14
|
+
#
|
15
|
+
# Result::
|
16
|
+
# * Array<Symbol>: List of supported locales
|
17
|
+
def self.supported_locales
|
18
|
+
# This method has to publish the list of translations it accepts.
|
19
|
+
[:en]
|
20
|
+
end
|
21
|
+
|
22
|
+
# Create a report for a list of nodes, in a given locale
|
23
|
+
# [API] - This method is mandatory.
|
24
|
+
#
|
25
|
+
# Parameters::
|
26
|
+
# * *nodes* (Array<String>): List of nodes
|
27
|
+
# * *locale_code* (Symbol): The locale code
|
28
|
+
def report_for(nodes, locale_code)
|
29
|
+
# This method simply provides a report for a given list of nodes in the desired locale.
|
30
|
+
# The locale will be one of the supported ones.
|
31
|
+
# Generate the report in a file to be uploaded on web10.
|
32
|
+
File.write(
|
33
|
+
'/tmp/web_report.txt',
|
34
|
+
@platforms_handler.known_platforms.map do |platform|
|
35
|
+
"= Inventory for platform #{platform.repository_path} of type #{platform.platform_type}:\n" +
|
36
|
+
platform.known_nodes.map do |node|
|
37
|
+
"* Node #{node} (IP: #{@nodes_handler.get_host_ip_of(node)}, Hostname: #{@nodes_handler.get_hostname_of(node)})."
|
38
|
+
end.join("\n")
|
39
|
+
end.join("\n")
|
40
|
+
)
|
41
|
+
# Upload the file on our web10 instance
|
42
|
+
system 'scp -o StrictHostKeyChecking=no /tmp/web_report.txt root@web10.hpc_tutorial.org:/root/hello_world.txt'
|
43
|
+
out 'Upload successful'
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module MyHpcPlugins
|
2
|
+
|
3
|
+
module HpcPlugins
|
4
|
+
|
5
|
+
module Test
|
6
|
+
|
7
|
+
# Check root space
|
8
|
+
class RootSpace < HybridPlatformsConductor::Test
|
9
|
+
|
10
|
+
# Run test using SSH commands on the node.
|
11
|
+
# Instead of executing the SSH commands directly on each node for each test, this method returns the list of commands to run and the test framework then groups them in 1 SSH connection.
|
12
|
+
# [API] - @node can be used to adapt the command with the node.
|
13
|
+
#
|
14
|
+
# Result::
|
15
|
+
# * Hash<String,Object>: For each command to execute, information regarding the assertion.
|
16
|
+
# * Values can be:
|
17
|
+
# * Proc: The code block making the test given the stdout of the command. Here is the Proc description:
|
18
|
+
# * Parameters::
|
19
|
+
# * *stdout* (Array<String>): List of lines of the stdout of the command.
|
20
|
+
# * *stderr* (Array<String>): List of lines of the stderr of the command.
|
21
|
+
# * *return_code* (Integer): The return code of the command.
|
22
|
+
# * Hash<Symbol,Object>: More complete information, that can contain the following keys:
|
23
|
+
# * *validator* (Proc): The proc containing the assertions to perform (as described above). This key is mandatory.
|
24
|
+
# * *timeout* (Integer): Timeout to wait for this command to execute.
|
25
|
+
def test_on_node
|
26
|
+
# If this method is defined, it will be used to execute SSH commands on each node that is being tested.
|
27
|
+
# For each SSH command, a validator code block will be called with the stdout of the command run remotely on the node.
|
28
|
+
# In place of a simple validator code block, a more complex structure can be used to give more info (for example timeout).
|
29
|
+
{
|
30
|
+
'du -sk /root' => proc do |stdout|
|
31
|
+
# stdout contains the output of our du command
|
32
|
+
used_kb = stdout.first.split.first.to_i
|
33
|
+
error "Root space used is #{used_kb}KB - too much!" if used_kb > 1024
|
34
|
+
end
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'my_hpc_plugins'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.date = '2021-04-29'
|
5
|
+
s.authors = ['Me myself!']
|
6
|
+
s.email = ['me-myself@my-domain.com']
|
7
|
+
s.summary = 'My awesome plugins for Hybrid Platforms Conductor'
|
8
|
+
s.files = Dir['{bin,lib,spec}/**/*']
|
9
|
+
Dir['bin/**/*'].each do |exec_name|
|
10
|
+
s.executables << File.basename(exec_name)
|
11
|
+
end
|
12
|
+
# Dependencies
|
13
|
+
# Make sure we use a compatible version of hybrid_platforms_conductor
|
14
|
+
s.add_dependency 'hybrid_platforms_conductor', '~> 32.12'
|
15
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# syntax=docker/dockerfile:1
|
2
|
+
# Pull the image containing Go
|
3
|
+
FROM golang:1.16.3-buster
|
4
|
+
|
5
|
+
# Install the web server
|
6
|
+
# Create the message file to be displayed by the web server
|
7
|
+
COPY hello_world.txt /root/hello_world.txt
|
8
|
+
# Copy the code
|
9
|
+
COPY main.go /codebase/src/main.go
|
10
|
+
# Build the binary
|
11
|
+
RUN cd /codebase && go build -v -o /codebase/bin/server ./src/main.go
|
12
|
+
# Set the env which will be available at runtime
|
13
|
+
ENV PORT=80
|
14
|
+
EXPOSE 80
|
15
|
+
|
16
|
+
# Install sshd
|
17
|
+
RUN apt-get update && apt-get install -y openssh-server
|
18
|
+
RUN mkdir /var/run/sshd
|
19
|
+
# Activate root login
|
20
|
+
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
21
|
+
# Speed-up considerably ssh performance and avoid huge lags and timeouts without DNS
|
22
|
+
RUN sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
|
23
|
+
EXPOSE 22
|
24
|
+
|
25
|
+
# Upload our root key for key authentication of root
|
26
|
+
COPY hpc_root.key.pub /root/.ssh/authorized_keys
|
27
|
+
RUN chmod 700 /root/.ssh
|
28
|
+
RUN chmod 400 /root/.ssh/authorized_keys
|
29
|
+
|
30
|
+
# Startup script
|
31
|
+
COPY start.sh /start.sh
|
32
|
+
RUN chmod +x /start.sh
|
33
|
+
CMD ["/start.sh"]
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello World!
|
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN OPENSSH PRIVATE KEY-----
|
2
|
+
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
|
3
|
+
NhAAAAAwEAAQAAAQEAu5oVFddWtHFKA8+PnRssWieXrnMUPM8+qTdQrxoMaNacFWN+pBv3
|
4
|
+
Nj61GphCANoEPBvgcm7ltgZa1EumAZh4NJFi7AqM4Z2AFsqsvzRS1HNFRClEwr576iRkMc
|
5
|
+
ECIr0JmxeOscVcDMx0/9uFSfON7DiuStOOpIJIiQfjtFBsLFpzdfsVfZ3zc18Hxugqsbq0
|
6
|
+
t0bsTZdjRKnIYeKTSXKbF2n9b/dAf2tBtpywpun1WXQul7w1z20m9zv955k4kq3rAhSIPH
|
7
|
+
aOSE+QCXlICYqwmP2KVKCG6XEqSWjF4ujzcE7PlKIK1gsXdfum6GL23X8k8njBIjRzq6a0
|
8
|
+
Uabp65tvVQAAA8hgF2y/YBdsvwAAAAdzc2gtcnNhAAABAQC7mhUV11a0cUoDz4+dGyxaJ5
|
9
|
+
eucxQ8zz6pN1CvGgxo1pwVY36kG/c2PrUamEIA2gQ8G+BybuW2BlrUS6YBmHg0kWLsCozh
|
10
|
+
nYAWyqy/NFLUc0VEKUTCvnvqJGQxwQIivQmbF46xxVwMzHT/24VJ843sOK5K046kgkiJB+
|
11
|
+
O0UGwsWnN1+xV9nfNzXwfG6CqxurS3RuxNl2NEqchh4pNJcpsXaf1v90B/a0G2nLCm6fVZ
|
12
|
+
dC6XvDXPbSb3O/3nmTiSresCFIg8do5IT5AJeUgJirCY/YpUoIbpcSpJaMXi6PNwTs+Uog
|
13
|
+
rWCxd1+6boYvbdfyTyeMEiNHOrprRRpunrm29VAAAAAwEAAQAAAQEAj5IE7vkkvuUweqgf
|
14
|
+
RWGlWL2SJIyngT4tuzy8/7SUqKsNOoUxRxCr6ZSl7tt1L8eplALVi135aIuGeZAHVJNF8x
|
15
|
+
0Mso4EcSmi/E5RU+cMONCawuY+XDeBB5igIT+PjdxT/KBTsRLUNmtGYwSyBf1hsNVT9ang
|
16
|
+
MWAPeOdTyQv/LRUe+O/ZKQ/h/X51BEwSXqz32RmlmZdMnDacIJ0NWdbcbAEtB4JT83S20d
|
17
|
+
bycQNOxGVmyevOGjyTXfUX6FhtYT7A7zzqNUL8UstSdajWeTZvVGd0C7Ob1kxaU3tnAwFr
|
18
|
+
0sHTPHX7FQQFGhiU8gBZHOJ/PQzo+qqcCSsM3FcJlpVw5QAAAIAPYGXt7diWFYEhZVfj3n
|
19
|
+
KA0lX7LjQms0en4CoSkN4BELQJnaaqlTkrqN7PNL/WbmeavzDqQMk1jb9Q2+gra826THX5
|
20
|
+
GGtbFPFb9TSwBNi+zsyVURKEzqNYSw28ytKIdj98VW1qqQoolgTc5qoXG1JW5f5bEPbzUT
|
21
|
+
LXPP5j+YvuCgAAAIEA8NVJc5vXzJxbdgBxOPPHaPCAZ28V15Ggy+Bj1K/9G6FHqa/SFhy0
|
22
|
+
tCpBDNB/POX2UXCQDLteTIDodj9h2Yat6PJP9RKYCC9F5+/fU/0Y/tvD/p/uNhwEuqToex
|
23
|
+
gBUoL+r7/G3qYK13n8AKwrvb2wiYgP3aUVW7AyOier1MKt4OsAAACBAMdqmcj+5fNSTuOg
|
24
|
+
iPgGylUSIYnJ0w2jjZIaX96aat/w+SgciLhenbwpcf/9E8MDYKbXyhArdQvOgkEVogEI4s
|
25
|
+
PrFG66ogawPuRUUsuZBhm/b535EEvNAlkC8fMPVuKfOIsHJs8Cwcy7QPZSZu5pyKznpnCT
|
26
|
+
UlYGT6aB0GGoeeC/AAAAEWFkbWluQGV4YW1wbGUuY29tAQ==
|
27
|
+
-----END OPENSSH PRIVATE KEY-----
|
@@ -0,0 +1 @@
|
|
1
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7mhUV11a0cUoDz4+dGyxaJ5eucxQ8zz6pN1CvGgxo1pwVY36kG/c2PrUamEIA2gQ8G+BybuW2BlrUS6YBmHg0kWLsCozhnYAWyqy/NFLUc0VEKUTCvnvqJGQxwQIivQmbF46xxVwMzHT/24VJ843sOK5K046kgkiJB+O0UGwsWnN1+xV9nfNzXwfG6CqxurS3RuxNl2NEqchh4pNJcpsXaf1v90B/a0G2nLCm6fVZdC6XvDXPbSb3O/3nmTiSresCFIg8do5IT5AJeUgJirCY/YpUoIbpcSpJaMXi6PNwTs+UogrWCxd1+6boYvbdfyTyeMEiNHOrprRRpunrm29V admin@example.com
|
@@ -0,0 +1,43 @@
|
|
1
|
+
package main
|
2
|
+
|
3
|
+
import (
|
4
|
+
"fmt"
|
5
|
+
"io/ioutil"
|
6
|
+
"log"
|
7
|
+
"net/http"
|
8
|
+
"os"
|
9
|
+
)
|
10
|
+
|
11
|
+
const homepageEndPoint = "/"
|
12
|
+
|
13
|
+
// StartWebServer the webserver
|
14
|
+
func StartWebServer() {
|
15
|
+
http.HandleFunc(homepageEndPoint, handleHomepage)
|
16
|
+
port := os.Getenv("PORT")
|
17
|
+
if len(port) == 0 {
|
18
|
+
panic("Environment variable PORT is not set")
|
19
|
+
}
|
20
|
+
|
21
|
+
log.Printf("Starting web server to listen on endpoints [%s] and port %s",
|
22
|
+
homepageEndPoint, port)
|
23
|
+
if err := http.ListenAndServe(":"+port, nil); err != nil {
|
24
|
+
panic(err)
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
func handleHomepage(w http.ResponseWriter, r *http.Request) {
|
29
|
+
urlPath := r.URL.Path
|
30
|
+
log.Printf("Web request received on url path %s", urlPath)
|
31
|
+
content, content_err := ioutil.ReadFile("/root/hello_world.txt")
|
32
|
+
if content_err != nil {
|
33
|
+
fmt.Printf("Failed to read message to display, err: %s", content_err)
|
34
|
+
}
|
35
|
+
_, write_err := w.Write(content)
|
36
|
+
if write_err != nil {
|
37
|
+
fmt.Printf("Failed to write response, err: %s", write_err)
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
func main() {
|
42
|
+
StartWebServer()
|
43
|
+
}
|
data/tools/generate_mermaid
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hybrid_platforms_conductor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 32.13.
|
4
|
+
version: 32.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muriel Salvan
|
@@ -391,6 +391,71 @@ extra_rdoc_files:
|
|
391
391
|
- examples/localhost/inventory.yaml
|
392
392
|
- examples/bare/Gemfile
|
393
393
|
- examples/bare/hpc_config.rb
|
394
|
+
- examples/tutorial/02_first_node/my-platforms/Gemfile
|
395
|
+
- examples/tutorial/02_first_node/my-platforms/hpc_config.rb
|
396
|
+
- examples/tutorial/02_first_node/node/my-service.conf
|
397
|
+
- examples/tutorial/02_first_node/my-service-conf-repo/my-service.conf.erb
|
398
|
+
- examples/tutorial/02_first_node/my-service-conf-repo/service_my-service.rb
|
399
|
+
- examples/tutorial/02_first_node/my-service-conf-repo/inventory.yaml
|
400
|
+
- examples/tutorial/03_scale/my-platforms/Gemfile
|
401
|
+
- examples/tutorial/03_scale/my-platforms/hpc_config.rb
|
402
|
+
- examples/tutorial/03_scale/my-platforms/my_commands.bash
|
403
|
+
- examples/tutorial/03_scale/node/my-service.conf
|
404
|
+
- examples/tutorial/03_scale/web_docker_image/hpc_root.key
|
405
|
+
- examples/tutorial/03_scale/web_docker_image/main.go
|
406
|
+
- examples/tutorial/03_scale/web_docker_image/Dockerfile
|
407
|
+
- examples/tutorial/03_scale/web_docker_image/hello_world.txt
|
408
|
+
- examples/tutorial/03_scale/web_docker_image/hpc_root.key.pub
|
409
|
+
- examples/tutorial/03_scale/web_docker_image/test.bash
|
410
|
+
- examples/tutorial/03_scale/web_docker_image/start.sh
|
411
|
+
- examples/tutorial/03_scale/my-service-conf-repo/my-service.conf.erb
|
412
|
+
- examples/tutorial/03_scale/my-service-conf-repo/service_my-service.rb
|
413
|
+
- examples/tutorial/03_scale/my-service-conf-repo/inventory.yaml
|
414
|
+
- examples/tutorial/03_scale/my-service-conf-repo/service_web-hello.rb
|
415
|
+
- examples/tutorial/01_installation/my-platforms/Gemfile
|
416
|
+
- examples/tutorial/01_installation/my-platforms/hpc_config.rb
|
417
|
+
- examples/tutorial/04_test/my-platforms/Gemfile
|
418
|
+
- examples/tutorial/04_test/my-platforms/hpc_config.rb
|
419
|
+
- examples/tutorial/04_test/my-platforms/my_commands.bash
|
420
|
+
- examples/tutorial/04_test/my-platforms/images/debian_10/Dockerfile
|
421
|
+
- examples/tutorial/04_test/node/my-service.conf
|
422
|
+
- examples/tutorial/04_test/web_docker_image/hpc_root.key
|
423
|
+
- examples/tutorial/04_test/web_docker_image/main.go
|
424
|
+
- examples/tutorial/04_test/web_docker_image/Dockerfile
|
425
|
+
- examples/tutorial/04_test/web_docker_image/hello_world.txt
|
426
|
+
- examples/tutorial/04_test/web_docker_image/hpc_root.key.pub
|
427
|
+
- examples/tutorial/04_test/web_docker_image/test.bash
|
428
|
+
- examples/tutorial/04_test/web_docker_image/start.sh
|
429
|
+
- examples/tutorial/04_test/my-service-conf-repo/my-service.conf.erb
|
430
|
+
- examples/tutorial/04_test/my-service-conf-repo/service_my-service.rb
|
431
|
+
- examples/tutorial/04_test/my-service-conf-repo/inventory.yaml
|
432
|
+
- examples/tutorial/04_test/my-service-conf-repo/service_web-hello.rb
|
433
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/report/web_report.rb
|
434
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/test/root_space.rb
|
435
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/platform_handler/json_bash.rb
|
436
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/my_hpc_plugins.gemspec
|
437
|
+
- examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key
|
438
|
+
- examples/tutorial/05_extend_with_plugins/dev_docker_image/Dockerfile
|
439
|
+
- examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key.pub
|
440
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/Gemfile
|
441
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/hpc_config.rb
|
442
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/my_commands.bash
|
443
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/images/debian_10/Dockerfile
|
444
|
+
- examples/tutorial/05_extend_with_plugins/node/my-service.conf
|
445
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key
|
446
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/main.go
|
447
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/Dockerfile
|
448
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/hello_world.txt
|
449
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key.pub
|
450
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/test.bash
|
451
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/start.sh
|
452
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/my-service.conf.erb
|
453
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_my-service.rb
|
454
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/inventory.yaml
|
455
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_web-hello.rb
|
456
|
+
- examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-gcc.bash
|
457
|
+
- examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/hosts.json
|
458
|
+
- examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-python.bash
|
394
459
|
files:
|
395
460
|
- CHANGELOG.md
|
396
461
|
- LICENSE.md
|
@@ -500,6 +565,71 @@ files:
|
|
500
565
|
- examples/localhost/Gemfile
|
501
566
|
- examples/localhost/hpc_config.rb
|
502
567
|
- examples/localhost/inventory.yaml
|
568
|
+
- examples/tutorial/01_installation/my-platforms/Gemfile
|
569
|
+
- examples/tutorial/01_installation/my-platforms/hpc_config.rb
|
570
|
+
- examples/tutorial/02_first_node/my-platforms/Gemfile
|
571
|
+
- examples/tutorial/02_first_node/my-platforms/hpc_config.rb
|
572
|
+
- examples/tutorial/02_first_node/my-service-conf-repo/inventory.yaml
|
573
|
+
- examples/tutorial/02_first_node/my-service-conf-repo/my-service.conf.erb
|
574
|
+
- examples/tutorial/02_first_node/my-service-conf-repo/service_my-service.rb
|
575
|
+
- examples/tutorial/02_first_node/node/my-service.conf
|
576
|
+
- examples/tutorial/03_scale/my-platforms/Gemfile
|
577
|
+
- examples/tutorial/03_scale/my-platforms/hpc_config.rb
|
578
|
+
- examples/tutorial/03_scale/my-platforms/my_commands.bash
|
579
|
+
- examples/tutorial/03_scale/my-service-conf-repo/inventory.yaml
|
580
|
+
- examples/tutorial/03_scale/my-service-conf-repo/my-service.conf.erb
|
581
|
+
- examples/tutorial/03_scale/my-service-conf-repo/service_my-service.rb
|
582
|
+
- examples/tutorial/03_scale/my-service-conf-repo/service_web-hello.rb
|
583
|
+
- examples/tutorial/03_scale/node/my-service.conf
|
584
|
+
- examples/tutorial/03_scale/web_docker_image/Dockerfile
|
585
|
+
- examples/tutorial/03_scale/web_docker_image/hello_world.txt
|
586
|
+
- examples/tutorial/03_scale/web_docker_image/hpc_root.key
|
587
|
+
- examples/tutorial/03_scale/web_docker_image/hpc_root.key.pub
|
588
|
+
- examples/tutorial/03_scale/web_docker_image/main.go
|
589
|
+
- examples/tutorial/03_scale/web_docker_image/start.sh
|
590
|
+
- examples/tutorial/03_scale/web_docker_image/test.bash
|
591
|
+
- examples/tutorial/04_test/my-platforms/Gemfile
|
592
|
+
- examples/tutorial/04_test/my-platforms/hpc_config.rb
|
593
|
+
- examples/tutorial/04_test/my-platforms/images/debian_10/Dockerfile
|
594
|
+
- examples/tutorial/04_test/my-platforms/my_commands.bash
|
595
|
+
- examples/tutorial/04_test/my-service-conf-repo/inventory.yaml
|
596
|
+
- examples/tutorial/04_test/my-service-conf-repo/my-service.conf.erb
|
597
|
+
- examples/tutorial/04_test/my-service-conf-repo/service_my-service.rb
|
598
|
+
- examples/tutorial/04_test/my-service-conf-repo/service_web-hello.rb
|
599
|
+
- examples/tutorial/04_test/node/my-service.conf
|
600
|
+
- examples/tutorial/04_test/web_docker_image/Dockerfile
|
601
|
+
- examples/tutorial/04_test/web_docker_image/hello_world.txt
|
602
|
+
- examples/tutorial/04_test/web_docker_image/hpc_root.key
|
603
|
+
- examples/tutorial/04_test/web_docker_image/hpc_root.key.pub
|
604
|
+
- examples/tutorial/04_test/web_docker_image/main.go
|
605
|
+
- examples/tutorial/04_test/web_docker_image/start.sh
|
606
|
+
- examples/tutorial/04_test/web_docker_image/test.bash
|
607
|
+
- examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/hosts.json
|
608
|
+
- examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-gcc.bash
|
609
|
+
- examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-python.bash
|
610
|
+
- examples/tutorial/05_extend_with_plugins/dev_docker_image/Dockerfile
|
611
|
+
- examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key
|
612
|
+
- examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key.pub
|
613
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/Gemfile
|
614
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/hpc_config.rb
|
615
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/images/debian_10/Dockerfile
|
616
|
+
- examples/tutorial/05_extend_with_plugins/my-platforms/my_commands.bash
|
617
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/inventory.yaml
|
618
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/my-service.conf.erb
|
619
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_my-service.rb
|
620
|
+
- examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_web-hello.rb
|
621
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/platform_handler/json_bash.rb
|
622
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/report/web_report.rb
|
623
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/test/root_space.rb
|
624
|
+
- examples/tutorial/05_extend_with_plugins/my_hpc_plugins/my_hpc_plugins.gemspec
|
625
|
+
- examples/tutorial/05_extend_with_plugins/node/my-service.conf
|
626
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/Dockerfile
|
627
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/hello_world.txt
|
628
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key
|
629
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key.pub
|
630
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/main.go
|
631
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/start.sh
|
632
|
+
- examples/tutorial/05_extend_with_plugins/web_docker_image/test.bash
|
503
633
|
- lib/hybrid_platforms_conductor/action.rb
|
504
634
|
- lib/hybrid_platforms_conductor/actions_executor.rb
|
505
635
|
- lib/hybrid_platforms_conductor/bitbucket.rb
|