Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iotamak-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMAC
AMAK
Python
IoTAMAK
iotamak-core
Commits
171d9047
Commit
171d9047
authored
3 years ago
by
shinedday
Browse files
Options
Downloads
Patches
Plain Diff
Fix update
parent
531d0e6a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dist/iotAmak-0.0.1-py3-none-any.whl
+0
-0
0 additions, 0 deletions
dist/iotAmak-0.0.1-py3-none-any.whl
iotAmak/amas.py
+1
-1
1 addition, 1 deletion
iotAmak/amas.py
iotAmak/ihm.py
+3
-2
3 additions, 2 deletions
iotAmak/ihm.py
iotAmak/tool/ssh_client.py
+8
-2
8 additions, 2 deletions
iotAmak/tool/ssh_client.py
with
12 additions
and
5 deletions
dist/iotAmak-0.0.1-py3-none-any.whl
+
0
−
0
View file @
171d9047
No preview for this file type
This diff is collapsed.
Click to expand it.
iotAmak/amas.py
+
1
−
1
View file @
171d9047
...
@@ -57,7 +57,7 @@ class Amas(Schedulable, SSHClient):
...
@@ -57,7 +57,7 @@ class Amas(Schedulable, SSHClient):
if
args
is
None
:
if
args
is
None
:
args
=
[]
args
=
[]
command
=
"
nohup python
"
command
=
"
nohup python
"
command
+=
"
\"
Desktop/mqtt_goyon/
iotamak-cor
e/
"
+
experience_name
+
"
/agent.py
\"
"
command
+=
"
\"
Desktop/mqtt_goyon/
exampl
e/
"
+
experience_name
+
"
/agent.py
\"
"
command
+=
str
(
self
.
next_id
)
+
"
\"
"
command
+=
str
(
self
.
next_id
)
+
"
\"
"
command
+=
str
(
self
.
broker_ip
)
+
"
\"
"
command
+=
str
(
self
.
broker_ip
)
+
"
\"
"
for
arg
in
args
:
for
arg
in
args
:
...
...
This diff is collapsed.
Click to expand it.
iotAmak/ihm.py
+
3
−
2
View file @
171d9047
...
@@ -80,8 +80,6 @@ class Ihm(MqttClient, SSHClient):
...
@@ -80,8 +80,6 @@ class Ihm(MqttClient, SSHClient):
self
.
loading
()
self
.
loading
()
self
.
ping
()
self
.
ping
()
if
self
.
ping_is_true
:
self
.
agent
()
while
not
exit_bool
:
while
not
exit_bool
:
...
@@ -144,6 +142,9 @@ class Ihm(MqttClient, SSHClient):
...
@@ -144,6 +142,9 @@ class Ihm(MqttClient, SSHClient):
self
.
update
(
self
.
experiment_name
)
self
.
update
(
self
.
experiment_name
)
if
cmd
.
lower
()
==
"
agent
"
:
self
.
agent
()
# Crée les processus amas/env/scheduler de l'experience chargé
# Crée les processus amas/env/scheduler de l'experience chargé
if
cmd
.
lower
()
==
"
start
"
:
if
cmd
.
lower
()
==
"
start
"
:
...
...
This diff is collapsed.
Click to expand it.
iotAmak/tool/ssh_client.py
+
8
−
2
View file @
171d9047
...
@@ -50,7 +50,13 @@ class SSHClient:
...
@@ -50,7 +50,13 @@ class SSHClient:
transport
.
connect
(
username
=
client
.
user
,
password
=
client
.
password
)
transport
.
connect
(
username
=
client
.
user
,
password
=
client
.
password
)
sftp
=
MySFTPClient
.
from_transport
(
transport
)
sftp
=
MySFTPClient
.
from_transport
(
transport
)
sftp
.
mkdir
(
"
Desktop/mqtt_goyon/example/
"
+
experiment_name
,
ignore_existing
=
True
)
sftp
.
mkdir
(
"
Desktop/mqtt_goyon/example/
"
+
experiment_name
,
ignore_existing
=
True
)
sftp
.
put_dir
(
"
../
"
+
experiment_name
,
"
Desktop/mqtt_goyon/example/
"
+
experiment_name
)
print
(
str
(
pathlib
.
Path
().
resolve
()),
"
Desktop/mqtt_goyon/example/
"
+
experiment_name
)
sftp
.
put_dir
(
str
(
pathlib
.
Path
().
resolve
()),
"
Desktop/mqtt_goyon/example/
"
+
experiment_name
)
sftp
.
close
()
sftp
.
close
()
class
MySFTPClient
(
paramiko
.
SFTPClient
):
class
MySFTPClient
(
paramiko
.
SFTPClient
):
...
@@ -62,7 +68,7 @@ class MySFTPClient(paramiko.SFTPClient):
...
@@ -62,7 +68,7 @@ class MySFTPClient(paramiko.SFTPClient):
for
item
in
os
.
listdir
(
source
):
for
item
in
os
.
listdir
(
source
):
if
os
.
path
.
isfile
(
os
.
path
.
join
(
source
,
item
)):
if
os
.
path
.
isfile
(
os
.
path
.
join
(
source
,
item
)):
self
.
put
(
os
.
path
.
join
(
source
,
item
),
'
%s/%s
'
%
(
target
,
item
))
self
.
put
(
os
.
path
.
join
(
source
,
item
),
'
%s/%s
'
%
(
target
,
item
))
print
(
os
.
path
.
join
(
source
,
item
))
print
(
os
.
path
.
join
(
target
,
item
))
else
:
else
:
if
any
([
i
in
item
for
i
in
[
"
.git
"
,
"
__pycache__
"
,
"
.idea
"
,
"
.vscode
"
]]):
if
any
([
i
in
item
for
i
in
[
"
.git
"
,
"
__pycache__
"
,
"
.idea
"
,
"
.vscode
"
]]):
pass
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment