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
d90d71c4
Commit
d90d71c4
authored
3 years ago
by
Nathan Hertz
Browse files
Options
Downloads
Patches
Plain Diff
Made changes to work with modified CARTA-2.0 AppImage
parent
e0194dd1
No related branches found
No related tags found
1 merge request
!519
WS-641: CARTA 2.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/cli/executables/pexable/carta_envoy/carta_envoy/connect.py
+17
-14
17 additions, 14 deletions
...li/executables/pexable/carta_envoy/carta_envoy/connect.py
with
17 additions
and
14 deletions
apps/cli/executables/pexable/carta_envoy/carta_envoy/connect.py
+
17
−
14
View file @
d90d71c4
...
...
@@ -147,21 +147,24 @@ class RedisConnect:
"""
self
.
logger
.
info
(
"
Determining values for Redis...
"
)
service_name
=
generate_random_str
()
session
=
f
"
carta-
{
service_name
}
"
front_end
=
f
"
carta-front-
{
service_name
}
"
back_end
=
f
"
carta-back-
{
service_name
}
"
carta_wrapper
=
f
"
carta-wrapper-
{
service_name
}
"
hostname
=
socket
.
getfqdn
()
values
=
{
# FRONT END
#
f"traefik/http/routers/{front_end}/rule": f"Host(`{reverse_proxy_host}`) && PathPrefix(`/{
front_end
_id}/`)",
#
f"traefik/http/routers/{front_end}/service": front_end,
#
f"traefik/http/services/{front_end}/loadbalancer/servers/0/url": f"http://{hostname}:{
front_end
_port}/",
#
f"traefik/http/routers/{front_end}/middlewares/0": "stripPrefixFE@file",
f
"
traefik/http/routers/
{
front_end
}
/rule
"
:
f
"
Host(`
{
reverse_proxy_host
}
`) && PathPrefix(`/
{
session
_id
}
/`)
"
,
f
"
traefik/http/routers/
{
front_end
}
/service
"
:
front_end
,
f
"
traefik/http/services/
{
front_end
}
/loadbalancer/servers/0/url
"
:
f
"
http://
{
hostname
}
:
{
session
_port
}
/
"
,
f
"
traefik/http/routers/
{
front_end
}
/middlewares/0
"
:
"
stripPrefixFE@file
"
,
# BACK END
f
"
traefik/http/routers/
{
session
}
/rule
"
:
f
"
Host(`
{
reverse_proxy_host
}
`) && PathPrefix(`/
{
session_id
}
/`)
"
,
f
"
traefik/http/routers/
{
session
}
/service
"
:
session
,
f
"
traefik/http/services/
{
session
}
/loadbalancer/servers/0/url
"
:
f
"
http://
{
hostname
}
:
{
session_port
}
/
"
,
f
"
traefik/http/routers/
{
session
}
/middlewares/0
"
:
"
upgradeWSHeader@file
"
,
f
"
traefik/http/routers/
{
session
}
/middlewares/1
"
:
"
stripPrefixFE@file
"
,
# Both sets of rules are very similar; small difference is with the missing / at end of PathPrefix
# This is needed to successfully connect to the web socket because CARTA says so
f
"
traefik/http/routers/
{
back_end
}
/rule
"
:
f
"
Host(`
{
reverse_proxy_host
}
`) && PathPrefix(`/
{
session_id
}
`)
"
,
f
"
traefik/http/routers/
{
back_end
}
/service
"
:
back_end
,
f
"
traefik/http/services/
{
back_end
}
/loadbalancer/servers/0/url
"
:
f
"
http://
{
hostname
}
:
{
session_port
}
/
"
,
f
"
traefik/http/routers/
{
back_end
}
/middlewares/0
"
:
"
upgradeWSHeader@file
"
,
f
"
traefik/http/routers/
{
back_end
}
/middlewares/1
"
:
"
stripPrefixFE@file
"
,
# WRAPPER
f
"
traefik/http/routers/
{
carta_wrapper
}
/rule
"
:
f
"
Host(`
{
reverse_proxy_host
}
`) && PathPrefix(`/
{
carta_wrapper_id
}
/`)
"
,
f
"
traefik/http/routers/
{
carta_wrapper
}
/service
"
:
carta_wrapper
,
...
...
@@ -177,9 +180,7 @@ class RedisConnect:
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
"
],
...
...
@@ -225,7 +226,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
)
...
...
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