Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Merge requests
!498
WS-645: Move images out of subdirectories
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
WS-645: Move images out of subdirectories
WS-673_fix_single_img_crash_issue
into
main
Overview
0
Commits
6
Pipelines
3
Changes
3
Merged
Charlotte Hausman
requested to merge
WS-673_fix_single_img_crash_issue
into
main
3 years ago
Overview
0
Commits
6
Pipelines
3
Changes
3
Expand
0
0
Merge request reports
Viewing commit
85e73da9
Prev
Next
Show latest version
3 files
+
85
−
14
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
85e73da9
WS-645: move images out of subdirectories
· 85e73da9
Charlotte Hausman
authored
3 years ago
apps/cli/executables/pexable/carta_envoy/carta_envoy/connect.py
+
9
−
13
Options
@@ -40,13 +40,7 @@ class RedisConnect:
proxy
=
self
.
settings
[
"
reverse_proxy
"
]
carta_url
=
f
"
https://
{
proxy
}
/
{
front_end_id
}
/?socketUrl=wss://
{
proxy
}
/
{
back_end_id
}
/
"
if
self
.
settings
[
"
single_image
"
]:
carta_url
=
(
carta_url
+
"
&file=
"
+
self
.
settings
[
"
image_name
"
]
+
"
/
"
+
self
.
settings
[
"
image_name
"
]
)
carta_url
=
carta_url
+
"
&file=
"
+
self
.
settings
[
"
image_name
"
]
self
.
logger
.
info
(
f
"
Carta URL:
{
carta_url
}
"
)
return
carta_url
@@ -168,24 +162,24 @@ class RedisConnect:
f
"
traefik/http/routers/
{
carta_wrapper
}
/middlewares/0
"
:
"
stripPrefixFE@file
"
,
}
unique_values
=
self
.
check_for_duplicate_values
(
values
,
front_end_port
,
back_end_port
)
unique_values
=
self
.
check_for_duplicate_values
(
values
,
front_end_port
,
back_end_port
,
wrapper_port
)
self
.
redis_values
=
unique_values
return
unique_values
def
check_for_duplicate_values
(
self
,
redis_values
:
dict
,
front_port
:
int
,
back_port
:
int
):
def
check_for_duplicate_values
(
self
,
redis_values
:
dict
,
front_port
:
int
,
back_port
:
int
,
wrapper_port
:
int
):
self
.
logger
.
info
(
"
Checking for duplicate values on server...
"
)
for
key
in
redis_values
:
if
self
.
conn
.
get
(
key
):
self
.
logger
.
warning
(
"
WARNING: Redis value collision found. Generating new random IDs.
"
)
self
.
logger
.
warning
(
"
WARNING: Redis value collision found. Generating new random IDs.
"
)
self
.
generated_ids
=
self
.
generate_ids
()
new_values
=
self
.
get_redis_values
(
self
.
settings
[
"
reverse_proxy
"
],
self
.
generated_ids
[
"
front_end_id
"
],
self
.
generated_ids
[
"
back_end_id
"
],
self
.
generated_ids
[
"
wrapper_id
"
],
front_port
,
back_port
,
wrapper_port
,
)
return
new_values
@@ -224,7 +218,9 @@ class ArchiveConnect:
:param url: URL generated to allow user access to this running CARTA instance
"""
send_archive_msg_url
=
f
"
{
self
.
settings
[
'
workflow_url
'
]
}
/workflows/carta/requests/
{
self
.
settings
[
'
wf_request_id
'
]
}
/send-url-to-aat
"
send_archive_msg_url
=
(
f
"
{
self
.
settings
[
'
workflow_url
'
]
}
/workflows/carta/requests/
{
self
.
settings
[
'
wf_request_id
'
]
}
/send-url-to-aat
"
)
payload
=
{
"
carta_url
"
:
url
}
self
.
logger
.
info
(
"
Sending REST call to workflow service for AAT messaging.
"
)
requests
.
post
(
send_archive_msg_url
,
json
=
payload
)
Loading