Skip to content
Snippets Groups Projects
Commit c0c2a780 authored by dilawar's avatar dilawar :ant:
Browse files

Merge branch 'subcom.bitia.link' into 'main'

feat: Use new default server subcom.bitia.link

See merge request !23
parents 3ee9da42 8ae56cf2
No related branches found
No related tags found
1 merge request!23feat: Use new default server subcom.bitia.link
Pipeline #6319 passed with stages
in 2 minutes and 27 seconds
......@@ -8,7 +8,7 @@ import validators
BITIA_MAIN_SCRIPT_NAME: T.Final[str] = "__main__.bitia.sh"
_config = {"server": "https://public.bitia.link/api/v1"}
_config = {"server": "https://subcom.bitia.link/api/v1"}
def set_config(key, val):
......
......@@ -6,6 +6,7 @@ __email__ = "dilawar@subcom.tech"
import sys
from pathlib import Path
import typing as T
from urllib.parse import urlparse
import requests
......@@ -22,11 +23,6 @@ def log_container(container: str, server: str, *, timestamps: bool = False):
yield line
def _check_server_status(server: str) -> int:
res = requests.get(server)
return res.status_code
def post_pipeline_task(
pipeline: Pipeline,
*,
......@@ -36,11 +32,6 @@ def post_pipeline_task(
**kwargs,
):
"""Submit to the api for a given endpoint and pipeline file"""
if (code := _check_server_status(server)) != 200:
logger.warning(
"%s may not be alive (status code: %s). Try other one?", server, code
)
sys.exit(1)
pipeline_zip = pipeline.zipfile
numbytes = pipeline_zip.stat().st_size
assert numbytes > 0
......@@ -99,11 +90,6 @@ def submit_job(
):
"""Submit job to the API and stream the output."""
numbytes = pipeline_zip.stat().st_size
if (code := _check_server_status(server)) != 200:
logger.warning(
"%s may not be alive (status code: %s). Try other one?", server, code
)
sys.exit(1)
assert numbytes > 0
logger.info(
"Submitting %s (size=%.2f KB) to the %s",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment