Skip to content
Merged

Dev #445

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bfa34bd
Merge pull request #427 from Baltic-RCC/mk-hotfix-read-slack
m-karo Jan 5, 2026
5698734
Update hours in month_ahead configuration
MK1295 Jan 13, 2026
91a4a20
#412 Excluded negative values from sum conform loads
gpoderys Jan 18, 2026
5cd551f
bugfix: disconnect kriegers flak
m-karo Jan 19, 2026
6369117
#431 Temporarily disabled outage fixing
gpoderys Jan 21, 2026
beccb40
Merge pull request #434 from Baltic-RCC/gp-tmp-hotfix-outages
VeikoAunapuu Jan 22, 2026
e134467
Merge pull request #432 from Baltic-RCC/gp-conform-loads
VeikoAunapuu Jan 22, 2026
17eae2d
try to fix shunts without regulating control
VeikoAunapuu Jan 29, 2026
d201a21
Optimal shunt checker
VeikoAunapuu Jan 29, 2026
8729b35
bugfix: disconnect kriegers flak
m-karo Jan 19, 2026
c5630a9
bugfix: fragmented area participation calculation returned zero
m-karo Feb 3, 2026
968eb41
SSH update map updated
VeikoAunapuu Feb 4, 2026
be3570c
Merge branch 'dev' of https://github.com/Baltic-RCC/EMF into dev
VeikoAunapuu Feb 4, 2026
9389f46
#431 Re-enabled outage fixing after updating outage mrid handling
gpoderys Feb 9, 2026
fa8d112
bugfix: unintentional comment
gpoderys Feb 9, 2026
3b61910
#431 aligned mrid format with new uap index data
gpoderys Feb 11, 2026
711d921
added three regulation control fixes
VeikoAunapuu Feb 13, 2026
4d47c70
#374 reafactor: migrated from pipenv to uv dependency management
m-karo Feb 18, 2026
4adb724
#438 feature: Elasticsearch integration support for API KEY
m-karo Feb 18, 2026
cdc0d35
Merge pull request #441 from Baltic-RCC/va-reg-control
VeikoAunapuu Feb 23, 2026
65b696c
deps: locked triplets 0.0.11
m-karo Feb 24, 2026
d461c4a
deps: upgraded opdmapi to latest version
m-karo Feb 24, 2026
91b541a
deps: elasticsearch 8.15.0
m-karo Feb 25, 2026
bb36d6c
#425 Minio storage update, recommited missing code
gpoderys Mar 3, 2026
f9f6375
Updated tieline pairing function to consider cim:Tieflow attribute, t…
gpoderys Mar 4, 2026
90e298c
Update replacement_length request_list values
VeikoAunapuu Mar 5, 2026
e82380b
#439 Net interchange function now updates ssh values by default witho…
gpoderys Mar 5, 2026
71a7a19
#440 bugfix: ignore scaling on disconnected EQINJ (case for HVDC)
m-karo Feb 23, 2026
fde2003
#437 Outage fix configuration updated, minor outage update function b…
gpoderys Mar 6, 2026
9f6ea50
Merge branch 'main' into dev
VeikoAunapuu Mar 9, 2026
ded9659
bugfix: Quality module LT-PL flow rule LT area name updated
gpoderys Mar 10, 2026
b9acb38
Update replacement_length request_list values
VeikoAunapuu Mar 11, 2026
d490059
licenses: included third party licenses of used modules in project
m-karo Mar 13, 2026
612e9ab
bugfix: elastic logging handler missing api_key
m-karo Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ jobs:
docker build . \
--file docker/Dockerfile \
--target emfos-base \
-t ${{ vars.DOCKER_USERNAME }}/emfos-base:main
docker push ${{ vars.DOCKER_USERNAME}}/emfos-base:main

-t ${{ vars.DOCKER_USERNAME }}/emfos-base:latest
docker push ${{ vars.DOCKER_USERNAME}}/emfos-base:latest

- name: Display Success Message
run: echo "emfos-base image has been built and pushed manually."
Binary file added DEPENDENCY_LICENSES.md
Binary file not shown.
29 changes: 0 additions & 29 deletions Pipfile

This file was deleted.

988 changes: 0 additions & 988 deletions Pipfile.lock

This file was deleted.

1 change: 0 additions & 1 deletion config/cgm_worker/post_processing.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[MAIN]
NET_INTERCHANGE_THRESHOLD = 200
FIX_INJECTION_ERRORS = True
INJECTION_THRESHOLD = 0.1
SMALL_ISLAND_SIZE = 10
4 changes: 2 additions & 2 deletions config/cgm_worker/replacement_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"request_list": ["ID", "1D", "2D", "WK", "1D", "MO", "YR"]
},
"replacement_length": {
"request_list": ["6d", "6d", "6d", "2w", "6d", "1M", "4M"]
"request_list": ["2w", "2w", "2w", "2w", "6d", "1M", "4M"]
},
"month_ahead": {
"hours": ["07:30", "08:30", "09:30", "06:30", "05:30", "04:30"],
"hours": ["09:30", "08:30", "10:30", "11:30", "07:30", "12:30"],
"business_type": ["1D","2D"]
},
"hours": [
Expand Down
1 change: 1 addition & 0 deletions config/integrations/elastic.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[MAIN]
ELK_SERVER = access_url
ELK_TOKEN = access_token
BATCH_SIZE = 20000
3 changes: 2 additions & 1 deletion config/task_generator/manual_task_generator.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ TASK_VERSION =
TASK_MERGING_ENTITY =
RUN_REPLACEMENT =
RUN_SCALING =
OUTAGE_UPDATE =
FORCE_OUTAGE_FIX =
UPLOAD_TO_OPDM =
UPLOAD_TO_MINIO =
SEND_MERGE_REPORT =
POST_TEMP_FIXES =
FORCE_OUTAGE_FIX =
FIX_NET_INTERCHANGE2 =
LVL8_REPORTING =
42 changes: 14 additions & 28 deletions config/task_generator/process_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "True",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -70,13 +69,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "True",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -106,13 +104,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "True",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -142,13 +139,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "True",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "True",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -178,13 +174,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "True",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
}
Expand Down Expand Up @@ -232,13 +227,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -275,13 +269,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -318,13 +311,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -360,13 +352,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -403,13 +394,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -446,13 +436,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -489,13 +478,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -536,13 +524,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
},
Expand Down Expand Up @@ -580,13 +567,12 @@
"replacement_local":"False",
"pre_temp_fixes":"True",
"post_temp_fixes":"True",
"fix_net_interchange2": "False",
"outage_update": "True",
"force_outage_fix":"False",
"scaling": "False",
"upload_to_opdm": "False",
"upload_to_minio": "True",
"send_merge_report": "True",
"force_outage_fix": "False",
"lvl8_reporting" : "True"
}
}
Expand Down
22 changes: 12 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ WORKDIR /src

# Install tools to set up python environment
RUN apt-get update && apt-get install -y --no-install-recommends procps && rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade setuptools pip uv pipenv

# Install needed modules
COPY Pipfile .
COPY Pipfile.lock .
#RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
#RUN pipenv install --system --deploy
RUN pipenv requirements > requirements.txt
RUN uv pip sync requirements.txt --system
#RUN uv cache clean
RUN pip install --upgrade setuptools pip uv

# Sync python modules as dependencies
COPY pyproject.toml .
COPY uv.lock .
RUN uv export -o pylock.toml
RUN uv pip sync pylock.toml --system && uv cache clean

# Copy license file and dependencies license reference
RUN mkdir -p /licenses
COPY LICENSE /licenses/
COPY licenses/ /licenses/

# Set to use interpreter from venv (if venv is used)
#ENV PATH="/.venv/bin:$PATH"
Expand Down
16 changes: 11 additions & 5 deletions emf/common/integrations/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@

class Elastic:

def __init__(self, server: str = ELK_SERVER, debug: bool = False):
def __init__(self, server: str = ELK_SERVER, api_key: str = ELK_TOKEN, debug: bool = False):
self.server = server
self.debug = debug
self.client = Elasticsearch(self.server)
self.client = Elasticsearch(self.server, api_key=api_key)

@staticmethod
def send_to_elastic(index: str,
json_message: dict,
id: str = None,
server: str = ELK_SERVER,
api_key: str = ELK_TOKEN,
iso_timestamp: str = None,
debug: bool = False):
"""
Expand Down Expand Up @@ -64,7 +65,8 @@ def send_to_elastic(index: str,
if json_message.get('args', None): # TODO revise if this is proper solution
json_message.pop('args')
json_data = json.dumps(json_message, default=str, ensure_ascii=True, skipkeys=True)
response = requests.post(url=url, data=json_data.encode(), headers={"Content-Type": "application/json"})
headers = {"Authorization": f"ApiKey {api_key}", "Content-Type": "application/json"}
response = requests.post(url=url, data=json_data.encode(), headers=headers, verify=False)
if json.loads(response.content).get('error'):
logger.error(f"Send to Elasticsearch responded with error: {response.text}")
if debug:
Expand All @@ -79,6 +81,7 @@ def send_to_elastic_bulk(index: str,
id_metadata_list: List[str] | None = None,
hashing: bool = False,
server: str = ELK_SERVER,
api_key: str = ELK_TOKEN,
batch_size: int = int(BATCH_SIZE),
iso_timestamp: str | None = None,
debug: bool = False):
Expand Down Expand Up @@ -127,10 +130,12 @@ def __generate_id(element):
# Executing POST to push messages into ELK
if debug:
logger.debug(f"Sending batch ({batch}-{batch + batch_size})/{len(json_message_list)} to {url}")
headers = {"Authorization": f"ApiKey {api_key}", "Content-Type": "application/x-ndjson"}
response = requests.post(url=url,
data=(ndjson.dumps(json_message_list[batch:batch + batch_size])+"\n").encode(),
timeout=None,
headers={"Content-Type": "application/x-ndjson"})
headers=headers,
verify=False)
if json.loads(response.content).get('errors'):
logger.error(f"Send to Elasticsearch responded with errors: {response.text}")
if debug:
Expand Down Expand Up @@ -259,7 +264,8 @@ def handle(self, message: bytes, properties: dict, **kwargs):

# Create client
server = "access_url"
service = Elastic(server=server)
api_key = "acces_token"
service = Elastic(server=server, api_key=api_key)

# Example get documents by query
# query = {"match": {"scenario_date": "2023-03-21"}}
Expand Down
Loading
Loading