apache / submarine

Submarine is Cloud Native Machine Learning Platform.
https://submarine.apache.org/
Apache License 2.0
689 stars 252 forks source link

SUBMARINE-1395. Remove unauthenticated login #1092

Closed cdmikechen closed 11 months ago

cdmikechen commented 1 year ago

What is this PR for?

Backend server no longer supports login without authentication (except python-sdk), REST must authenticate first (/api/auth/token) and add a token in header to be accessed.

What type of PR is it?

Feature

Todos

What is the Jira issue?

https://issues.apache.org/jira/browse/SUBMARINE-1395

How should this be tested?

CI test

Screenshots (if appropriate)

NA

Questions:

codecov[bot] commented 1 year ago

Codecov Report

Merging #1092 (73e871f) into master (f170037) will decrease coverage by 0.44%. Report is 1 commits behind head on master. The diff coverage is 66.07%.

@@            Coverage Diff             @@
##           master    #1092      +/-   ##
==========================================
- Coverage   67.27%   66.83%   -0.44%     
==========================================
  Files         128      130       +2     
  Lines        6224     6320      +96     
==========================================
+ Hits         4187     4224      +37     
- Misses       2037     2096      +59     
Flag Coverage Δ
python-integration 53.97% <66.07%> (+0.34%) :arrow_up:
python-unit 47.86% <43.13%> (-0.15%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...ysubmarine/submarine/client/api/environment_api.py 75.17% <ø> (ø)
...pysubmarine/submarine/client/api/experiment_api.py 45.51% <ø> (ø)
...ne/submarine/client/api/experiment_template_api.py 19.35% <ø> (ø)
...e/submarine/client/api/experiment_templates_api.py 15.55% <ø> (ø)
...ubmarine/submarine/client/api/model_version_api.py 10.61% <ø> (ø)
...k/pysubmarine/submarine/client/api/notebook_api.py 79.85% <ø> (ø)
...arine/submarine/client/api/registered_model_api.py 11.32% <ø> (ø)
...-sdk/pysubmarine/submarine/client/api/serve_api.py 19.51% <ø> (ø)
...e-sdk/pysubmarine/submarine/client/api/auth_api.py 27.77% <27.77%> (ø)
...pysubmarine/submarine/client/models/login_param.py 41.07% <41.07%> (ø)
... and 19 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

cdmikechen commented 1 year ago

It looks like we meet no space left on device error again. https://github.com/apache/submarine/actions/runs/5693116661/job/15444228405?pr=1092

image
cdmikechen commented 11 months ago

Currently the following error occurs inside the new ci testing process: https://github.com/apache/submarine/actions/runs/5840601129/job/15840001205

image

This is caused by some data within submarine_test that shouldn't be there. I'm currently looking for the exact cause.

cdmikechen commented 11 months ago

Since some of the submarine-server-core tests are started based on the built-in jetty, that test cases do not go through the hard-coded logic of org.apache.submarine.server.database.utils.checkCalledByTestMethod at startup, making the startup of the test case go to submarine's database, causing a database processing exception.

https://github.com/apache/submarine/blob/f170037c1e7642c16cd5fa1707e85abd6252d839/submarine-server/server-database/src/main/java/org/apache/submarine/server/database/utils/MyBatisUtil.java#L83-L104

cdmikechen commented 11 months ago

A related issue https://issues.apache.org/jira/browse/SUBMARINE-1297 has already been created before, and is currently being temporarily resolved by setting the environment variable for JDBC_URL=jdbc:mysql://127.0.0.1:3306/submarine_test?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false. This should be fully resolved when the issue is resolved.