Skip to content

Commit

Permalink
Updated SSB workshop to CSA 1.7.0.1 and fixed a few issues with reset…
Browse files Browse the repository at this point in the history
…-to-lab for that version.
  • Loading branch information
asdaraujo committed Jul 22, 2022
1 parent e1c25ad commit 8ced5f9
Show file tree
Hide file tree
Showing 37 changed files with 119 additions and 78 deletions.
Binary file modified images/ssb/add-catalog-sr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ssb/add-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/add-kafka-provider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/add-sr-catalog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/add-table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ssb/code-completion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/detect-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/edit-job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/event-time-column.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/first-query.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ssb/hide-tables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/job-details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/jobs-running.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/kafka-source.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/mv-config1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/mv-config2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ssb/mv-config2b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/mv-config3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/mv-contents.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/mv-parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/mv-url-parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/ssb/new-job.png
Binary file not shown.
Binary file modified images/ssb/register-kafka-provider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/ssb/removed-create-table.png
Binary file not shown.
Binary file modified images/ssb/source-properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ssb/source-transformations.png
Binary file modified images/ssb/sql-aggr-results.png
Binary file removed images/ssb/sql-aggregation.png
Diff not rendered.
Binary file modified images/ssb/sql-execution.png
Binary file modified images/ssb/sr-tables.png
Binary file modified images/ssb/stats-results.png
Binary file removed images/ssb/stop-job.png
Diff not rendered.
Binary file modified images/ssb/template-kafka-json.png
Binary file modified images/ssb/template-table-ddl.png
Binary file modified images/ssb/template-table-edited.png
29 changes: 21 additions & 8 deletions setup/terraform/resources/labs/utils/ssb.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ def _get_csrf_token(txt, quiet=True):


def _get_ui_port():
return '8001' if is_tls_enabled() else '8000'
if is_csa17_or_later():
return '8470' if is_tls_enabled() else '8070'
else:
return '8001' if is_tls_enabled() else '8000'


def _get_api_url():
return '{}://{}:{}/api/v1'.format(get_url_scheme(), get_hostname(), _get_ui_port())
if is_csa17_or_later():
return '{}://{}:{}'.format(get_url_scheme(), get_hostname(), _get_ui_port())
else:
return '{}://{}:{}/api/v1'.format(get_url_scheme(), get_hostname(), _get_ui_port())


def _get_rest_api_url():
Expand All @@ -61,16 +67,16 @@ def _get_url(api_type):
return _get_rest_api_url()


def _api_call(func, path, data=None, files=None, headers=None, api_type=_API_INTERNAL, token=False):
def _api_call(func, path, data=None, files=None, headers=None, api_type=_API_INTERNAL, token=False, auth=None):
global _SSB_CSRF_TOKEN
if not headers:
headers = {}
if api_type != _API_UI:
headers['Content-Type'] = 'application/json'
data = json.dumps(data)
auth = None
if is_kerberos_enabled():
auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
if not auth:
auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
else:
headers['Username'] = 'admin'
if token:
Expand All @@ -87,8 +93,8 @@ def _api_call(func, path, data=None, files=None, headers=None, api_type=_API_INT
return resp


def _api_get(path, data=None, api_type=_API_INTERNAL, token=False):
return _api_call(_get_session().get, path, data=data, api_type=api_type, token=token)
def _api_get(path, data=None, headers=None, api_type=_API_INTERNAL, token=False, auth=None):
return _api_call(_get_session().get, path, data=data, headers=headers, api_type=api_type, token=token, auth=auth)


def _api_post(path, data=None, files=None, headers=None, api_type=_API_INTERNAL, token=False):
Expand All @@ -107,7 +113,10 @@ def _get_session():
_SSB_SESSION.verify = get_truststore_path()

_api_get('/login', api_type=_API_UI)
_api_post('/login', {'next': '', 'login': _SSB_USER, 'password': get_the_pwd()}, api_type=_API_UI, token=True)
if is_csa17_or_later():
_api_get('/internal/user/current', auth=(_SSB_USER, get_the_pwd()))
else:
_api_post('/login', {'next': '', 'login': _SSB_USER, 'password': get_the_pwd()}, api_type=_API_UI, token=True)
return _SSB_SESSION


Expand All @@ -128,6 +137,10 @@ def is_csa16_or_later():
return _get_csa_version() >= [1, 6]


def is_csa17_or_later():
return _get_csa_version() >= [1, 7]


def is_ssb_installed():
return len(cm.get_services('SQL_STREAM_BUILDER')) > 0

Expand Down
168 changes: 98 additions & 70 deletions workshop_ssb.adoc

Large diffs are not rendered by default.

0 comments on commit 8ced5f9

Please sign in to comment.