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
Commits
461ddc2f
Commit
461ddc2f
authored
3 years ago
by
Janet Goldstein
Browse files
Options
Downloads
Patches
Plain Diff
WS-649: infrastructure for sending CARTA event info to Workspaces system
parent
b58f211c
No related branches found
No related tags found
1 merge request
!502
WS-649: send CARTA URL to workspaces system
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/cli/executables/pexable/carta_envoy/carta_envoy/connect.py
+6
-18
6 additions, 18 deletions
...li/executables/pexable/carta_envoy/carta_envoy/connect.py
with
6 additions
and
18 deletions
apps/cli/executables/pexable/carta_envoy/carta_envoy/connect.py
+
6
−
18
View file @
461ddc2f
...
...
@@ -50,9 +50,7 @@ class RedisConnect:
front_end_id
=
self
.
generated_ids
[
"
front_end_id
"
]
back_end_id
=
self
.
generated_ids
[
"
back_end_id
"
]
proxy
=
self
.
settings
[
"
reverse_proxy
"
]
carta_url
=
(
f
"
https://
{
proxy
}
/
{
front_end_id
}
/?socketUrl=wss://
{
proxy
}
/
{
back_end_id
}
/
"
)
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
"
]
...
...
@@ -181,21 +179,15 @@ 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
,
wrapper_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
,
wrapper_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
"
],
...
...
@@ -217,9 +209,7 @@ class RedisConnect:
:param redis_values: Dictionary of Redis entries
:param timeout_minutes: Timeout of the valet in minutes
"""
self
.
logger
.
info
(
f
"
Setting Redis values with a timeout of
{
timeout_minutes
}
minutes...
"
)
self
.
logger
.
info
(
f
"
Setting Redis values with a timeout of
{
timeout_minutes
}
minutes...
"
)
for
key
,
val
in
redis_values
.
items
():
self
.
conn
.
setex
(
key
,
60
*
timeout_minutes
+
60
,
val
)
...
...
@@ -272,9 +262,7 @@ class NotificationConnect:
self
.
logger
.
info
(
"
Not sending notification because no user email supplied
"
)
return
self
.
logger
.
info
(
f
"
Sending session ready notification with CARTA wrapper URL
{
wrapper_url
}
"
)
self
.
logger
.
info
(
f
"
Sending session ready notification with CARTA wrapper URL
{
wrapper_url
}
"
)
requests
.
post
(
f
"
{
self
.
url
}
/notify/carta_ready/send
"
,
json
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment