Skip to content

Commit

Permalink
[ZEPPELIN-6064] Change default web UI to new UI (#4802)
Browse files Browse the repository at this point in the history
* Change default web UI to new UI

* Rename web app context variables

* Fix keyword "Old" -> "Classic"

* Fix UI switch button phrases

* Change build profile for web UI

* Change configuration name (zeppelin.war -> zeppelin.classic.war)

* Change configuration name (zeppelin.angular.war -> zeppelin.war)

* Rename zeppelin-web to zeppelin-web-classic

* Rename zeppelin-web-angular to zeppelin-web

* Revert "Rename zeppelin-web-angular to zeppelin-web"

This reverts commit e53d069.

* Revert "Rename zeppelin-web to zeppelin-web-classic"

This reverts commit f9fe986.

* Revert "Change configuration name (zeppelin.angular.war -> zeppelin.war)"

This reverts commit 137d371.

* Revert "Change configuration name (zeppelin.war -> zeppelin.classic.war)"

This reverts commit 07bdf91.

* Fix selenium test build profile

* Fix e2e-tests profile

* Fix core.yml build profiles

* Fix DirAccessTest

* Fix zeppelin-integration url

* Fix rat check exclusion

* Add classic webapp path checking in zeppelin-daemon.sh
  • Loading branch information
tbonelee authored Sep 3, 2024
1 parent 22bfdc7 commit 7708b71
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 44 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
restore-keys: |
${{ runner.os }}-zeppelin-
- name: install application with some interpreter
run: ./mvnw install -Pbuild-distr -DskipTests -pl zeppelin-server,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown,angular,shell -am -Phelium-dev -Pexamples -P${{ matrix.hadoop }} ${MAVEN_ARGS}
run: ./mvnw install -Pbuild-distr -DskipTests -pl zeppelin-server,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown,angular,shell -am -Pweb-classic -Phelium-dev -Pexamples -P${{ matrix.hadoop }} ${MAVEN_ARGS}
- name: install and test plugins
run: ./mvnw package -pl zeppelin-plugins -amd ${MAVEN_ARGS}
- name: Setup conda environment with python 3.9 and R
Expand All @@ -85,7 +85,7 @@ jobs:
conda list
conda info
- name: run tests with ${{ matrix.hadoop }} # skip spark test because we would run them in other CI
run: ./mvnw verify -Pusing-packaged-distr -pl zeppelin-server,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown,angular,shell -am -Phelium-dev -Pexamples -P${{ matrix.hadoop }} -Dtests.to.exclude=**/org/apache/zeppelin/spark/* -DfailIfNoTests=false
run: ./mvnw verify -Pusing-packaged-distr -pl zeppelin-server,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown,angular,shell -am -Pweb-classic -Phelium-dev -Pexamples -P${{ matrix.hadoop }} -Dtests.to.exclude=**/org/apache/zeppelin/spark/* -DfailIfNoTests=false

# test interpreter modules except spark, flink, python, rlang, jupyter
interpreter-test-non-core:
Expand Down Expand Up @@ -221,7 +221,7 @@ jobs:
${{ runner.os }}-zeppelin-
- name: install environment
run: |
./mvnw install -DskipTests -Phadoop3 -Pintegration -pl zeppelin-interpreter-integration,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown,flink-cmd,flink/flink-scala-2.12,jdbc,shell -am -Pflink-117 ${MAVEN_ARGS}
./mvnw install -DskipTests -Phadoop3 -Pintegration -pl zeppelin-interpreter-integration,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown,flink-cmd,flink/flink-scala-2.12,jdbc,shell -am -Pweb-classic -Pflink-117 ${MAVEN_ARGS}
./mvnw package -pl zeppelin-plugins -amd -DskipTests ${MAVEN_ARGS}
- name: Setup conda environment with python 3.9 and R
uses: conda-incubator/setup-miniconda@v3
Expand Down Expand Up @@ -328,7 +328,7 @@ jobs:
${{ runner.os }}-zeppelin-
- name: install environment
run: |
./mvnw install -DskipTests -pl zeppelin-interpreter-integration,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown -am -Phadoop3 -Pintegration ${MAVEN_ARGS}
./mvnw install -DskipTests -pl zeppelin-interpreter-integration,zeppelin-web,spark-submit,spark/scala-2.12,spark/scala-2.13,markdown -am -Pweb-classic -Phadoop3 -Pintegration ${MAVEN_ARGS}
./mvnw clean package -pl zeppelin-plugins -amd -DskipTests ${MAVEN_ARGS}
- name: Setup conda environment with python 3.9 and R
uses: conda-incubator/setup-miniconda@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
restore-keys: |
${{ runner.os }}-zeppelin-
- name: Install application
run: ./mvnw clean install -DskipTests -am -pl zeppelin-web -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist ${MAVEN_ARGS}
run: ./mvnw clean install -DskipTests -am -pl zeppelin-web -Pweb-classic -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist ${MAVEN_ARGS}
- name: Run headless test
run: xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ./mvnw verify -pl zeppelin-web -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist -Pweb-e2e ${MAVEN_ARGS}
run: xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ./mvnw verify -pl zeppelin-web -Pweb-classic -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist -Pweb-e2e ${MAVEN_ARGS}
- name: Print zeppelin logs
if: always()
run: if [ -d "logs" ]; then cat logs/*; fi
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
restore-keys: |
${{ runner.os }}-zeppelin-
- name: Run headless test
run: xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ./mvnw package -pl zeppelin-web-angular -Pweb-angular ${MAVEN_ARGS}
run: xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" ./mvnw package -pl zeppelin-web-angular ${MAVEN_ARGS}

test-selenium-with-spark-module-for-spark-3-4:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -128,10 +128,10 @@ jobs:
R -e "IRkernel::installspec()"
- name: Install Environment
run: |
./mvnw clean install -DskipTests -am -pl zeppelin-integration -Pintegration -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist ${MAVEN_ARGS}
./mvnw clean install -DskipTests -am -pl zeppelin-integration -Pweb-classic -Pintegration -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist ${MAVEN_ARGS}
- name: run tests
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1600x1024x16" ./mvnw verify -DfailIfNoTests=false -pl zeppelin-integration -Pintegration -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist -Pusing-source-tree ${MAVEN_ARGS}
xvfb-run --auto-servernum --server-args="-screen 0 1600x1024x16" ./mvnw verify -DfailIfNoTests=false -pl zeppelin-integration -Pweb-classic -Pintegration -Pspark-scala-2.12 -Pspark-3.4 -Phadoop3 -Pweb-dist -Pusing-source-tree ${MAVEN_ARGS}
- name: Print zeppelin logs
if: always()
run: if [ -d "logs" ]; then cat logs/*; fi
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ ENV MAVEN_OPTS="-Xms1024M -Xmx2048M -XX:MaxMetaspaceSize=1024m -XX:-UseGCOverhea
# Allow npm and bower to run with root privileges
RUN echo "unsafe-perm=true" > ~/.npmrc && \
echo '{ "allow_root": true }' > ~/.bowerrc && \
./mvnw -B package -DskipTests -Pbuild-distr -Pspark-3.3 -Pinclude-hadoop -Phadoop3 -Pspark-scala-2.12 -Pweb-angular -Pweb-dist && \
./mvnw -B package -DskipTests -Pbuild-distr -Pspark-3.3 -Pinclude-hadoop -Phadoop3 -Pspark-scala-2.12 -Pweb-classic -Pweb-dist && \
# Example with doesn't compile all interpreters
# ./mvnw -B package -DskipTests -Pbuild-distr -Pspark-3.2 -Pinclude-hadoop -Phadoop3 -Pspark-scala-2.12 -Pweb-angular -Pweb-dist -pl '!groovy,!livy,!hbase,!file,!flink' && \
# ./mvnw -B package -DskipTests -Pbuild-distr -Pspark-3.2 -Pinclude-hadoop -Phadoop3 -Pspark-scala-2.12 -Pweb-classic -Pweb-dist -pl '!groovy,!livy,!hbase,!file,!flink' && \
mv /workspace/zeppelin/zeppelin-distribution/target/zeppelin-*/zeppelin-* /opt/zeppelin/ && \
# Removing stuff saves time, because docker creates a temporary layer
rm -rf ~/.m2 && \
Expand Down
16 changes: 11 additions & 5 deletions bin/zeppelin-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,20 @@ function wait_zeppelin_is_up_for_ci() {
if [[ "${CI}" == "true" ]]; then
local count=0;
while [[ "${count}" -lt 30 ]]; do
# check with angular webapp path
curl -v localhost:8080 2>&1 | grep '200 OK'
if [[ $? -ne 0 ]]; then
sleep 1
continue
else
if [[ $? -eq 0 ]]; then
break
fi
let "count+=1"

# check with classic webapp path
curl -v localhost:8080/classic/ 2>&1 | grep '200 OK'
if [[ $? -eq 0 ]]; then
break
fi

sleep 1
let "count+=1"
done
fi
}
Expand Down
4 changes: 2 additions & 2 deletions dev/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ function make_binary_release() {
git_clone
make_source_package

make_binary_release netinst "-Pweb-angular -pl !hbase,!jdbc,!file,!flink,!cassandra,!elasticsearch,!bigquery,!alluxio,!livy,!groovy,!java,!neo4j,!sparql,!mongodb,!shell -am"
make_binary_release netinst "-Pweb-classic -pl !hbase,!jdbc,!file,!flink,!cassandra,!elasticsearch,!bigquery,!alluxio,!livy,!groovy,!java,!neo4j,!sparql,!mongodb,!shell -am"

make_binary_release all "-Pweb-angular -pl !shell"
make_binary_release all "-Pweb-classic -pl !shell"

# remove non release files and dirs
rm -rf "${WORKING_DIR}/zeppelin"
Expand Down
2 changes: 1 addition & 1 deletion dev/publish_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if [[ $RELEASE_VERSION == *"SNAPSHOT"* ]]; then
DO_SNAPSHOT="yes"
fi

PUBLISH_PROFILES="-Ppublish-distr -Pweb-angular"
PUBLISH_PROFILES="-Ppublish-distr -Pweb-classic"
PROJECT_OPTIONS="-pl !zeppelin-distribution -Dmaven.javadoc.skip=true"
NEXUS_STAGING="https://repository.apache.org/service/local/staging"
NEXUS_PROFILE="153446d1ac37c4"
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<module>zeppelin-common</module>
<module>zeppelin-client</module>
<module>zeppelin-client-examples</module>
<module>zeppelin-web</module>
<module>zeppelin-web-angular</module>
<module>zeppelin-server</module>
<module>zeppelin-jupyter</module>
<module>zeppelin-plugins</module>
Expand Down Expand Up @@ -829,9 +829,9 @@

<profiles>
<profile>
<id>web-angular</id>
<id>web-classic</id>
<modules>
<module>zeppelin-web-angular</module>
<module>zeppelin-web</module>
</modules>
</profile>

Expand Down Expand Up @@ -1047,8 +1047,8 @@
<exclude>**/.babelrc</exclude>
<exclude>**/.bowerrc</exclude>
<exclude>.editorconfig</exclude>
<exclude>.eslintrc</exclude>
<exclude>protractor.conf.js</exclude>
<exclude>**/.eslintrc</exclude>
<exclude>**/protractor.conf.js</exclude>
<exclude>**/.tmp/**</exclude>
<exclude>**/target/**</exclude>
<exclude>**/node/**</exclude>
Expand Down
6 changes: 3 additions & 3 deletions zeppelin-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>zeppelin-web</artifactId>
<artifactId>zeppelin-web-angular</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
Expand Down Expand Up @@ -81,11 +81,11 @@

<profiles>
<profile>
<id>web-angular</id>
<id>web-classic</id>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>zeppelin-web-angular</artifactId>
<artifactId>zeppelin-web</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected void logoutUser(String userName) throws URISyntaxException {
manager.getWebDriver().findElement(
By.xpath("//*[@id='loginModal']//div[contains(@class, 'modal-header')]/button")).click();
}
manager.getWebDriver().get(new URI(manager.getWebDriver().getCurrentUrl()).resolve("/#/").toString());
manager.getWebDriver().get(new URI(manager.getWebDriver().getCurrentUrl()).resolve("/classic/#/").toString());
ZeppelinITUtils.sleep(500, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private WebDriver constructWebDriver(int port) {
throw new RuntimeException("No available WebDriver");
}

String url = "http://localhost:" + port;
String url = "http://localhost:" + port + "/classic";

long start = System.currentTimeMillis();
boolean loaded = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void testGroupPermission() throws Exception {
}

manager.getWebDriver().get(new URI(manager.getWebDriver().getCurrentUrl())
.resolve("/#/notebook/" + noteId).toString());
.resolve("/classic/#/notebook/" + noteId).toString());

List<WebElement> privilegesModal = manager.getWebDriver().findElements(
By.xpath("//div[@class='modal-content']//div[@class='bootstrap-dialog-header']" +
Expand All @@ -210,7 +210,7 @@ void testGroupPermission() throws Exception {
}

manager.getWebDriver().get(new URI(manager.getWebDriver().getCurrentUrl())
.resolve("/#/notebook/" + noteId).toString());
.resolve("/classic/#/notebook/" + noteId).toString());

privilegesModal = manager.getWebDriver().findElements(
By.xpath("//div[@class='modal-content']//div[@class='bootstrap-dialog-header']" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
/** Main class of Zeppelin. */
public class ZeppelinServer implements AutoCloseable {
private static final Logger LOGGER = LoggerFactory.getLogger(ZeppelinServer.class);
private static final String WEB_APP_CONTEXT_NEXT = "/next";
private static final String WEB_APP_CONTEXT_CLASSIC = "/classic";
public static final String DEFAULT_SERVICE_LOCATOR_NAME = "shared-locator";

private final AtomicBoolean duringShutdown = new AtomicBoolean(false);
Expand Down Expand Up @@ -226,11 +226,11 @@ protected void configure() {
});

// Multiple Web UI
final WebAppContext defaultWebApp = setupWebAppContext(contexts, zConf, zConf.getString(ConfVars.ZEPPELIN_WAR), zConf.getServerContextPath());
final WebAppContext nextWebApp = setupWebAppContext(contexts, zConf, zConf.getString(ConfVars.ZEPPELIN_ANGULAR_WAR), WEB_APP_CONTEXT_NEXT);
final WebAppContext defaultWebApp = setupWebAppContext(contexts, zConf, zConf.getString(ConfVars.ZEPPELIN_ANGULAR_WAR), zConf.getServerContextPath());
final WebAppContext classicWebApp = setupWebAppContext(contexts, zConf, zConf.getString(ConfVars.ZEPPELIN_WAR), WEB_APP_CONTEXT_CLASSIC);

initWebApp(defaultWebApp);
initWebApp(nextWebApp);
initWebApp(classicWebApp);

NotebookRepo repo =
ServiceLocatorUtilities.getService(sharedServiceLocator, NotebookRepo.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void testDirAccessOk() throws Exception {
}

protected String getUrlToTest() {
String url = "http://localhost:" + zConf.getServerPort();
String url = "http://localhost:" + zConf.getServerPort() + "/classic";
if (System.getProperty("url") != null) {
url = System.getProperty("url");
}
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"postinstall": "npm run build:projects",
"ng": "./node_modules/.bin/ng",
"start": "ng serve --proxy-config proxy.conf.js --extra-webpack-config webpack.partial.js",
"build": "ng build --prod --extra-webpack-config webpack.partial.js --base-href /next/",
"build": "ng build --prod --extra-webpack-config webpack.partial.js --base-href /",
"build:projects": "npm run build-project:sdk && npm run build-project:vis && npm run build-project:helium",
"build-helium-vis-example": " ng build --project helium-vis-example",
"build-project:sdk": " ng build --project zeppelin-sdk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<li nz-menu-item (click)="logout()">Logout</li>
</ng-container>
<li nz-menu-divider></li>
<li nz-menu-item><a href="/">Old Version</a></li>
<li nz-menu-item><a href="/classic">Switch to Classic UI</a></li>
</ul>
</nz-dropdown-menu>
</div>
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/e2e/collaborativeMode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// let test_text_1 = "_one_more_text_for_tests"; // without space!!!
// let test_text_2 = "Collaborative_mode_test_text"; // without space!!!
//
// browser.get('http://localhost:8080');
// browser.get('http://localhost:8080/classic');
// clickOn(element(by.linkText('Create new note')));
// waitVisibility(element(by.id('noteCreateModal')));
// clickOn(element(by.id('createNoteButton')));
Expand Down
4 changes: 2 additions & 2 deletions zeppelin-web/e2e/home.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Home e2e Test', function() {

//tests
it('should have a welcome message', function() {
browser.get('http://localhost:8080');
browser.get('http://localhost:8080/classic');
browser.sleep(500);
var welcomeElem = element(by.id('welcome'))

Expand Down Expand Up @@ -57,7 +57,7 @@ describe('Home e2e Test', function() {
scrollToElementAndClick(element(by.xpath('//*[@id="' + interpreterName + '"]//span[@class="fa fa-pencil"]')))
scrollToElementAndClick(element(by.xpath('//*[@id="' + interpreterName + '"]//button[@type="submit"]')))
clickOn(element(by.xpath('//div[@class="bootstrap-dialog-footer-buttons"]//button[contains(text(), \'OK\')]')))
browser.get('http://localhost:8080/#/interpreter');
browser.get('http://localhost:8080/classic/#/interpreter');
var text = element(by.xpath('//*[@id="' + interpreterName + '"]//li[contains(text(), \'admin\')]')).getText()
scrollToElementAndClick(element(by.xpath('//*[@id="' + interpreterName + '"]//span//span[@class="fa fa-trash"]')))
clickOn(element(by.xpath('//div[@class="bootstrap-dialog-footer-buttons"]//button[contains(text(), \'OK\')]')))
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/e2e/searchBlock.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Search block e2e Test', function() {
}

beforeEach(function() {
browser.get('http://localhost:8080')
browser.get('http://localhost:8080/classic')
browser.sleep(500);
waitVisibility(element(by.linkText('Create new note')))
clickOn(element(by.linkText('Create new note')))
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var baseConfig = {
baseUrl: 'http://localhost:8080/',
baseUrl: 'http://localhost:8080/classic',
directConnect: true,
capabilities: {
browserName: 'chrome',
Expand Down
2 changes: 1 addition & 1 deletion zeppelin-web/src/components/navbar/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<li ng-if="ticket.principal && ticket.principal !== 'anonymous'" role="separator" style="margin: 5px 0;" class="divider"></li>
<li ng-if="ticket.principal && ticket.principal !== 'anonymous'"><a ng-click="navbar.logout()">Logout</a></li>
<li role="separator" style="margin: 5px 0;" class="divider"></li>
<li><a href="/next">Try the new Zeppelin</a></li>
<li><a href="/">Switch to Default UI</a></li>
</ul>
</div>
</li>
Expand Down

0 comments on commit 7708b71

Please sign in to comment.