[ 
https://issues.apache.org/jira/browse/AMBARI-26064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

caijialiang updated AMBARI-26064:
---------------------------------
    Description: 
 According to the logs, it's still a UI failure, unable to find Chrome. It 
seems that besides the PhantomJS PR, there was an impact on CI/CD. It appears 
that the CI/CD scripts were also modified, causing the failure.

CI/CD configuration:

stage('Parallel Unit Tests') {
    parallel {
        stage('Ambari WebUI Tests') {
            steps {
                sh 'lsb_release -a'
                sh 'ls /usr/bin'
                sh 'find / -name "chromium-browser"'
                sh 'export CHROME_BIN=/usr/bin/chromium-browser'
                sh 'mvn -X -T 2C -am test -pl ambari-web,ambari-admin 
-Dmaven.artifact.threads=10 -Drat.skip'
            }
        }

        stage('Ambari Agent Tests') {
            steps {
                sh 'pip3 install distro'
                sh 'mvn -Dmaven.test.failure.ignore=true -am test -pl 
ambari-agent -Dmaven.artifact.threads=10 -Drat.skip'
            }
        }


In Ubuntu, the installation location of chromium-browser can vary depending on 
the method used for installation, such as directly from the Ubuntu repositories 
or through a snap package. Common installation locations include:

Installed via apt (Ubuntu repositories):

/usr/bin/chromium-browser
Installed via snap:

/snap/bin/chromium
For modifying the Jenkins script, there are two suggested approaches:

Approach 1: Limit the Search Scope
Since chromium-browser is most likely installed in /usr/bin/ or /snap/bin/ for 
snap installations, you can directly check these locations instead of the 
entire filesystem to avoid unnecessary permission issues. The modified Jenkins 
script could look like this:

stage('Parallel Unit Tests') {
    parallel {
        stage('Ambari WebUI Tests') {
            steps {
                sh 'lsb_release -a'
                sh 'ls /usr/bin'
                // Directly check possible installation locations
                sh 'if [ -f /usr/bin/chromium-browser ]; then export 
CHROME_BIN=/usr/bin/chromium-browser; fi'
                sh 'if [ -f /snap/bin/chromium ]; then export 
CHROME_BIN=/snap/bin/chromium; fi'
                sh 'mvn -X -T 2C -am test -pl ambari-web,ambari-admin 
-Dmaven.artifact.threads=10 -Drat.skip'
            }
        }
        // Other test stages...
    }
}
Approach 2: Using sudo
If you need to search the entire filesystem for chromium-browser and you have 
permissions to use sudo in Jenkins scripts, you can run the find command with 
sudo. However, this is generally not recommended for security reasons, as it 
could expose sensitive parts of the system or unnecessarily elevate script 
permissions. If you decide to use sudo, ensure the Jenkins user has appropriate 
sudo privileges and the sudoers configuration is correct. The modified command 
might look like:

sh 'sudo find / -name "chromium-browser" 2>/dev/null'
Here, 2>/dev/null is used to ignore error output, such as permission denied 
messages.

Security Tip: In production environments, avoid using sudo for commands that 
could affect system security and stability. Approach 1 is a safer, more focused 
method and should be considered first.

 

> Ambari CI/CD failed
> -------------------
>
>                 Key: AMBARI-26064
>                 URL: https://issues.apache.org/jira/browse/AMBARI-26064
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: caijialiang
>            Priority: Major
>
>  According to the logs, it's still a UI failure, unable to find Chrome. It 
> seems that besides the PhantomJS PR, there was an impact on CI/CD. It appears 
> that the CI/CD scripts were also modified, causing the failure.
> CI/CD configuration:
> stage('Parallel Unit Tests') {
>     parallel {
>         stage('Ambari WebUI Tests') {
>             steps {
>                 sh 'lsb_release -a'
>                 sh 'ls /usr/bin'
>                 sh 'find / -name "chromium-browser"'
>                 sh 'export CHROME_BIN=/usr/bin/chromium-browser'
>                 sh 'mvn -X -T 2C -am test -pl ambari-web,ambari-admin 
> -Dmaven.artifact.threads=10 -Drat.skip'
>             }
>         }
>         stage('Ambari Agent Tests') {
>             steps {
>                 sh 'pip3 install distro'
>                 sh 'mvn -Dmaven.test.failure.ignore=true -am test -pl 
> ambari-agent -Dmaven.artifact.threads=10 -Drat.skip'
>             }
>         }
> In Ubuntu, the installation location of chromium-browser can vary depending 
> on the method used for installation, such as directly from the Ubuntu 
> repositories or through a snap package. Common installation locations include:
> Installed via apt (Ubuntu repositories):
> /usr/bin/chromium-browser
> Installed via snap:
> /snap/bin/chromium
> For modifying the Jenkins script, there are two suggested approaches:
> Approach 1: Limit the Search Scope
> Since chromium-browser is most likely installed in /usr/bin/ or /snap/bin/ 
> for snap installations, you can directly check these locations instead of the 
> entire filesystem to avoid unnecessary permission issues. The modified 
> Jenkins script could look like this:
> stage('Parallel Unit Tests') {
>     parallel {
>         stage('Ambari WebUI Tests') {
>             steps {
>                 sh 'lsb_release -a'
>                 sh 'ls /usr/bin'
>                 // Directly check possible installation locations
>                 sh 'if [ -f /usr/bin/chromium-browser ]; then export 
> CHROME_BIN=/usr/bin/chromium-browser; fi'
>                 sh 'if [ -f /snap/bin/chromium ]; then export 
> CHROME_BIN=/snap/bin/chromium; fi'
>                 sh 'mvn -X -T 2C -am test -pl ambari-web,ambari-admin 
> -Dmaven.artifact.threads=10 -Drat.skip'
>             }
>         }
>         // Other test stages...
>     }
> }
> Approach 2: Using sudo
> If you need to search the entire filesystem for chromium-browser and you have 
> permissions to use sudo in Jenkins scripts, you can run the find command with 
> sudo. However, this is generally not recommended for security reasons, as it 
> could expose sensitive parts of the system or unnecessarily elevate script 
> permissions. If you decide to use sudo, ensure the Jenkins user has 
> appropriate sudo privileges and the sudoers configuration is correct. The 
> modified command might look like:
> sh 'sudo find / -name "chromium-browser" 2>/dev/null'
> Here, 2>/dev/null is used to ignore error output, such as permission denied 
> messages.
> Security Tip: In production environments, avoid using sudo for commands that 
> could affect system security and stability. Approach 1 is a safer, more 
> focused method and should be considered first.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ambari.apache.org
For additional commands, e-mail: issues-h...@ambari.apache.org

Reply via email to