Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libnrm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
argo
libnrm
Commits
21a99482
Commit
21a99482
authored
Dec 17, 2018
by
Swann Perarnau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] use the new downstream API
Match the changes made to the downstream API on the NRM side.
parent
4d816df0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
src/downstream_api.c
src/downstream_api.c
+2
-1
src/nrm.h
src/nrm.h
+5
-5
No files found.
src/downstream_api.c
View file @
21a99482
...
...
@@ -28,7 +28,8 @@ int nrm_init(struct nrm_context *ctxt, const char *uuid)
assert
(
ctxt
->
container_uuid
!=
NULL
);
ctxt
->
app_uuid
=
(
char
*
)
uuid
;
ctxt
->
context
=
zmq_ctx_new
();
ctxt
->
socket
=
zmq_socket
(
ctxt
->
context
,
ZMQ_PUB
);
ctxt
->
socket
=
zmq_socket
(
ctxt
->
context
,
ZMQ_DEALER
);
zmq_setsockopt
(
ctxt
->
socket
,
ZMQ_IDENTITY
,
ctxt
->
app_uuid
);
int
err
=
zmq_connect
(
ctxt
->
socket
,
uri
);
assert
(
err
==
0
);
char
buf
[
512
];
...
...
src/nrm.h
View file @
21a99482
...
...
@@ -28,13 +28,13 @@ struct nrm_context {
unsigned
long
acc
;
};
#define NRM_DEFAULT_URI "ipc:///tmp/nrm-downstream-
in
"
#define NRM_ENV_URI "ARGO_NRM_DOWNSTREAM_
IN
_URI"
#define NRM_DEFAULT_URI "ipc:///tmp/nrm-downstream-
event
"
#define NRM_ENV_URI "ARGO_NRM_DOWNSTREAM_
EVENT
_URI"
#define NRM_START_FORMAT "{\"
type\":\"application\", \"event\":\"start\", \"container\": \"%s\", \"uuid\": \"%s\", \"progress\": true, \"threads\": null
}"
#define NRM_PROGRESS_FORMAT "{\"
type\":\"application\", \"event\":\"progress\", \"payload\": \"%lu\", \"uuid\": \"%s
\"}"
#define NRM_START_FORMAT "{\"
api\":\"down_event\", \"type\":\"application_start\", \"container_uuid\": \"%s\", \"application_uuid\": \"%s\"
}"
#define NRM_PROGRESS_FORMAT "{\"
api\":\"down_event\", \"type\":\"progress\", \"payload\": \"%lu
\"}"
#define NRM_PHASE_CONTEXT_FORMAT "{\"type\":\"application\", \"event\":\"phase_context\", \"cpu\": \"%u\", \"aggregation\": \"%u\", \"computetime\": \"%llu\", \"totaltime\": \"%llu\", \"uuid\": \"%s\"}"
#define NRM_EXIT_FORMAT "{\"
type\":\"application\", \"event\":\"exit\", \"uuid\": \"%s
\"}"
#define NRM_EXIT_FORMAT "{\"
api\": \"down_event\", \"type\":\"application_exit
\"}"
int
nrm_init
(
struct
nrm_context
*
,
const
char
*
);
int
nrm_fini
(
struct
nrm_context
*
);
...
...
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