Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-23680

entrypoint.sh does not accept arbitrary UIDs, returning as an error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0
    • Component/s: Kubernetes, Spark Core
    • Labels:
    • Environment:

      OpenShift

    • Target Version/s:
    • Flags:
      Important

      Description

      Openshift supports running pods using arbitrary UIDs (https://docs.openshift.com/container-platform/3.7/creating_images/guidelines.html#openshift-specific-guidelines)  to improve security. Although entrypoint.sh was developed to cover this feature, the script is returning an error[1].

      The issue is that the script uses getent to find the passwd entry of the current UID, and if the entry is not found it creates an entry in /etc/passwd. According to the getent man page:

      EXIT STATUS
             One of the following exit values can be returned by getent:
                0         Command completed successfully.
                1         Missing arguments, or database unknown.
                2         One or more supplied key could not be found in the database.
                3         Enumeration not supported on this database.
      

      And since the script begin with a "set ex" command, which means it turns on debug and breaks the script if the command pipelines returns an exit code other than 0.-

      Having that said, this line below must be changed to remove the "-e" flag from set command:

      https://github.com/apache/spark/blob/v2.3.0/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh#L20

       

       [1]https://github.com/apache/spark/blob/v2.3.0/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh#L25-L34

        Attachments

          Activity

            People

            • Assignee:
              rmartine Ricardo Martinelli de Oliveira
              Reporter:
              rmartine Ricardo Martinelli de Oliveira
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: