Skip to content

Commit e353f73

Browse files
committed
chore: adds additional prometheus metrics to voting-node
1 parent 1e31ff3 commit e353f73

File tree

8 files changed

+327
-137
lines changed

8 files changed

+327
-137
lines changed

services/voting-node/Earthfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,24 @@ deps:
4343
# Install package dependencies without the voting_node package
4444
RUN poetry install --only main --no-root
4545
RUN poetry self add poetry-plugin-export
46-
46+
4747
# Copy the voting_node source code
4848
COPY --dir voting_node README.md ./
4949

5050
SAVE ARTIFACT .venv .venv
51-
SAVE IMAGE --cache-hint
51+
52+
lock:
53+
FROM +builder
54+
55+
WORKDIR /src/services/voting-node
56+
57+
COPY pyproject.toml .
58+
COPY poetry.lock .
59+
COPY ../../utilities/ideascale-importer+build/src /src/utilities/ideascale-importer
60+
61+
RUN poetry lock
62+
63+
SAVE ARTIFACT ./poetry.lock AS LOCAL poetry.lock
5264

5365
# Build for distribution
5466
build:

services/voting-node/blueprint.cue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ project: {
55

66
deployment: {
77
on: {
8-
merge: {}
9-
tag: {}
8+
//merge: {}
9+
//tag: {}
10+
always: {}
1011
}
1112

1213
bundle: {
@@ -94,7 +95,7 @@ project: {
9495
GVC_API_URL: value: string | *"unused"
9596
IS_NODE_RELOADABLE: value: string | *"true"
9697
VOTING_HOST: value: string | *"0.0.0.0"
97-
VOTING_PORT: value: string | *"8000"
98+
VOTING_PORT: value: string | *"8080"
9899
VOTING_LOG_LEVEL: value: string | *"debug"
99100
JORM_PATH: value: string | *"jormungandr"
100101
JCLI_PATH: value: string | *"jcli"
@@ -123,7 +124,7 @@ project: {
123124
}
124125
}
125126
ports: {
126-
http: port: 8080
127+
metrics: port: 8080
127128
}
128129
securityContext: {}
129130
}
@@ -215,7 +216,9 @@ project: {
215216
}
216217
}
217218

218-
service: {}
219+
service: {
220+
scrape: true
221+
}
219222

220223
volumes: snapshot: {
221224
size: "1Gi"
@@ -228,8 +231,9 @@ project: {
228231
release: {
229232
docker: {
230233
on: {
231-
merge: {}
232-
tag: {}
234+
//merge: {}
235+
//tag: {}
236+
always: {}
233237
}
234238
config: {
235239
tag: _ @forge(name="GIT_HASH_OR_TAG")

services/voting-node/entry.sh

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -139,28 +139,7 @@ export SSH_SNAPSHOT_TOOL_KEYFILE=/root/.ssh/id_snapshot
139139
# Sleep if DEBUG_SLEEP is set
140140
debug_sleep
141141

142-
# Define the command to be executed
143-
CMD_TO_RUN="voting-node start"
144-
145-
# Add $* to the command so that additional flags can be passed
146-
ARGS=$*
147-
CMD="$CMD_TO_RUN $ARGS"
148-
149-
# Wait for DEBUG_SLEEP seconds if the DEBUG_SLEEP environment variable is set
150-
if [ -n "${DEBUG_SLEEP:-}" ]; then
151-
echo "DEBUG_SLEEP is set to ${DEBUG_SLEEP}. Sleeping..."
152-
sleep "$DEBUG_SLEEP"
153-
fi
154-
155142
echo ">>> Executing command..."
156143
# Expand the command with arguments and capture the exit code
157144
set +e
158-
eval "$CMD"
159-
EXIT_CODE=$?
160-
set -e
161-
162-
# If the exit code is 0, the Python executable returned successfully
163-
if [ $EXIT_CODE -ne 0 ]; then
164-
echo "Error: Python executable returned with exit code $EXIT_CODE"
165-
exit 1
166-
fi
145+
exec voting-node start "$@"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"proposals": {
3+
"extra_field_mappings": {
4+
"auto_translated": "auto_translated",
5+
"brief": "challenge_brief",
6+
"budget_breakdown": "please_provide_a_detailed_budget_breakdown",
7+
"challenges_or_risks": "what_main_challenges_or_risks_do_you_foresee_to_deliver_this_project_successfully_",
8+
"full_solution": "please_describe_your_proposed_solution",
9+
"goal": "how_does_success_look_like_",
10+
"how_solution_address_challenge": "please_describe_how_your_proposed_solution_will_address_the_challenge_",
11+
"importance": "importance",
12+
"metrics": "key_metrics_to_measure",
13+
"new_proposal": "is_this_proposal_is_a_continuation_of_a_previously_funded_project_in_catalyst__or_an_entirely_new_o",
14+
"progress_metrics": "what_will_you_measure_to_track_your_project_s_progress__and_how_will_you_measure_it_",
15+
"relevant_link_1": "relevant_link_1",
16+
"relevant_link_2": "website__github_repository__or_any_other_relevant_link__",
17+
"relevant_link_3": "relevant_link_3",
18+
"return_in_a_later_round": "if_you_are_funded__will_you_return_to_catalyst_in_a_later_round_for_further_funding__please_explain",
19+
"sdg_rating": "sdg_rating",
20+
"solution": "problem_solution",
21+
"team_details": "please_provide_details_of_the_people_who_will_work_on_the_project_",
22+
"timeline_and_key_milestones": "please_provide_a_detailed_plan__a_timeline__and_key_milestones_for_delivering_your_proposal_"
23+
},
24+
"field_mappings": {
25+
"funds": [
26+
"requested_funds",
27+
"requested_funds_in_ada",
28+
"requested_funds_coti"
29+
],
30+
"proposer_relevant_experience": "relevant_experience",
31+
"proposer_url": [
32+
"relevant_link_1",
33+
"website__github_repository__or_any_other_relevant_link__",
34+
"relevant_link_3"
35+
],
36+
"public_key": "ada_payment_address__"
37+
}
38+
},
39+
"proposals_scores_csv": {
40+
"id_field": "proposal_id",
41+
"score_field": "Rating"
42+
}
43+
}

0 commit comments

Comments
 (0)