Commit c81c458d authored by Valentin Reis's avatar Valentin Reis

[refactor] use the new downstream nrm API

The ci setup was also changed to better isolate library building
from integration tests.
parents 4d816df0 fdb93a74
Pipeline #4773 passed with stages
in 26 seconds
stages: stages:
- build
- test - test
#- build
#make:generic: #make:generic:
#stage: build #stage: build
...@@ -16,11 +16,41 @@ stages: ...@@ -16,11 +16,41 @@ stages:
#except: #except:
#- /^wip.*/ #- /^wip.*/
#- /^WIP.*/ #- /^WIP.*/
#
integration.test: libnrm.build:
stage: build
script:
- nix-build .integration.nix -A libnrm
except:
- /^wip\/.*/
- /^WIP\/.*/
tags:
- integration
helloworld.integration.test:
stage: test
script:
- nix-shell .integration.nix -A test --run "argotk.hs helloworld"
artifacts:
paths:
- _output/cmd_err.log
- _output/cmd_out.log
- _output/daemon_out.log
- _output/daemon_out.log
- _output/nrm.log
- _output/.argo_nodeos_config_exit_message
expire_in: 1 week
except:
- /^wip\/.*/
- /^WIP\/.*/
tags:
- integration
perfwrapper.integration.test:
stage: test stage: test
script: script:
- nix-shell .integration.nix --run "argotk.hs helloworld" - nix-shell .integration.nix -A test --run "argotk.hs perfwrapper"
artifacts: artifacts:
paths: paths:
- _output/cmd_err.log - _output/cmd_err.log
...@@ -28,7 +58,6 @@ integration.test: ...@@ -28,7 +58,6 @@ integration.test:
- _output/daemon_out.log - _output/daemon_out.log
- _output/daemon_out.log - _output/daemon_out.log
- _output/nrm.log - _output/nrm.log
- _output/time.log
- _output/.argo_nodeos_config_exit_message - _output/.argo_nodeos_config_exit_message
expire_in: 1 week expire_in: 1 week
except: except:
......
{ argotest ? (builtins.fetchGit { { argotest ? (builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git; url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="refactor-argotk"; ref="master";
rev="e96e94a17a8046d0f7c8b2908dcb5fb25ead7b96"; }) rev="2589756882a96dee624f4ed420510b720a85f2b0";
})
}: }:
(import argotest { (import argotest {
libnrm-src = ./.; libnrm-src = ./.;
}).test nrm-src = builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/nrm.git;
ref="downstream-refactor";
rev="37f5594287f77e42f3bf5f6b5a89f387c8905137";
};
})
...@@ -28,7 +28,8 @@ int nrm_init(struct nrm_context *ctxt, const char *uuid) ...@@ -28,7 +28,8 @@ int nrm_init(struct nrm_context *ctxt, const char *uuid)
assert(ctxt->container_uuid != NULL); assert(ctxt->container_uuid != NULL);
ctxt->app_uuid = (char *)uuid; ctxt->app_uuid = (char *)uuid;
ctxt->context = zmq_ctx_new(); 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, strnlen(uuid, 255));
int err = zmq_connect(ctxt->socket, uri); int err = zmq_connect(ctxt->socket, uri);
assert(err == 0); assert(err == 0);
char buf[512]; char buf[512];
......
...@@ -28,13 +28,13 @@ struct nrm_context { ...@@ -28,13 +28,13 @@ struct nrm_context {
unsigned long acc; unsigned long acc;
}; };
#define NRM_DEFAULT_URI "ipc:///tmp/nrm-downstream-in" #define NRM_DEFAULT_URI "ipc:///tmp/nrm-downstream-event"
#define NRM_ENV_URI "ARGO_NRM_DOWNSTREAM_IN_URI" #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_START_FORMAT "{\"api\":\"down_event\", \"type\":\"application_start\", \"container_uuid\": \"%s\", \"application_uuid\": \"%s\"}"
#define NRM_PROGRESS_FORMAT "{\"type\":\"application\", \"event\":\"progress\", \"payload\": \"%lu\", \"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_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_init(struct nrm_context *, const char *);
int nrm_fini(struct nrm_context *); int nrm_fini(struct nrm_context *);
......
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