Page MenuHomePhabricator

Upgrade the spark YARN shuffler service on Hadoop workers from version 2 to 3
Closed, ResolvedPublic

Description

Our YARN nodes currently have two shuffler services available

  • mapreduce_shuffle
  • spark_shuffle

The mapreduce_shuffle service is not affected by this, but we need to address the upgrade of the spark_shuffler service to version 3.

There is further information about the shuffler service here: https://spark.apache.org/docs/latest/running-on-yarn.html#configuring-the-external-shuffle-service

The spark_shuffle service is enabled by the use of the following property in /etc/hadoop/conf/yarn-site.xml

<% if @yarn_use_spark_shuffle -%>
  <property>
    <name>yarn.nodemanager.aux-services.spark_shuffle.class</name>
    <value>org.apache.spark.network.yarn.YarnShuffleService</value>
  </property>
<% end -%>

However, the jar file that provides this spark_shuffle service is still the one that was shipped with our spark2 distribution.

btullis@an-worker1078:~$ find /usr/lib/hadoop-yarn/lib/ -name '*shuffle*' -ls
  1332949      0 lrwxrwxrwx   1 root     root           49 Mar  5  2021 /usr/lib/hadoop-yarn/lib/spark2-yarn-shuffle.jar -> /usr/lib/spark2/yarn/spark-2.4.4-yarn-shuffle.jar

We have a script in puppet that was used to make the spark2 shuffler jar file available to YARN nodemanagers.
https://github.com/wikimedia/operations-puppet/blob/production/modules/profile/files/hadoop/spark2/spark2_yarn_shuffle_jar_install.sh

A similar script was prepared ready for the spark3 upgrade:
https://github.com/wikimedia/operations-puppet/blob/production/modules/profile/files/hadoop/spark3/spark3_yarn_shuffle_jar_install.sh#L4

However, this script will not work because our distribution of spark3 is obtained from conda-forge:
https://gitlab.wikimedia.org/repos/data-engineering/conda-analytics/-/blob/main/conda-environment.yml#L11-12

Unfortunately, it seems that this version was not built with the YARN profile enabled, so there is no spark-3.1.2-yarn-shuffle.jar file available on the workers for us to symlink.

btullis@an-worker1078:~$ find /usr/lib/spark2/yarn
/usr/lib/spark2/yarn
/usr/lib/spark2/yarn/spark-2.4.4-yarn-shuffle.jar

btullis@an-worker1078:~$ find /usr/lib/spark3/yarn
find: '/usr/lib/spark3/yarn': No such file or directory

We have various options:

  • Download the jar manually and store it in Archiva, deploying it to the workers from there
  • Rebuild our spark distribution with the -Pyarn option

Details

TitleReferenceAuthorSource BranchDest Branch
Update the filename of the spark3 yarn shuffler jarrepos/data-engineering/conda-analytics!29btullisupdate_spark3_yarn_jar_filenamemain
Update the spark3 yarn shuffler jar filerepos/data-engineering/conda-analytics!27btullisadd_spark3_yarn_shufflemain
Release version 0.0.15repos/data-engineering/conda-analytics!26btullisrelease_v_0.0.15main
Revert the release of version 0.0.14 one final timerepos/data-engineering/conda-analytics!25btullisrevert_0.0.14_one_final_timemain
Undo release 0.0.14 againrepos/data-engineering/conda-analytics!24btullisrevert_0.0.14main
Revert another version 0.0.15 reference.repos/data-engineering/conda-analytics!23btullisrevert_stray_0.0.15_refmain
Revert the changes for release version 0.0.14repos/data-engineering/conda-analytics!22btullisrevert_release_0.0.14main
Fix incorrect package version valuesrepos/data-engineering/conda-analytics!21btullisfix_incorrect_version_infomain
Add the spark3 yarn shuffler jar to conda-analyticsrepos/data-engineering/conda-analytics!20btullisadd_spark3_shuffler_jarmain
Customize query in GitLab

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

The deb file for conda-analytics version 0.0.14 has now been published.
https://gitlab.wikimedia.org/repos/data-engineering/conda-analytics/-/packages/353

I'm now downloading this to apt1001 like this:

btullis@apt1001:~$ curl -o conda-analytics-0.0.14_amd64.deb https://gitlab.wikimedia.org/repos/data-engineering/conda-analytics/-/package_files/1259/download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  908M  100  908M    0     0   102M      0  0:00:08  0:00:08 --:--:--  104M

I'll update the version on the apt repositories, which is currently 0.0.13 in both buster and bullseye.

btullis@apt1001:~$ sudo -i reprepro ls conda-analytics
conda-analytics | 0.0.13 |   buster-wikimedia | amd64
conda-analytics | 0.0.13 | bullseye-wikimedia | amd64

First a quick check that the file exists within the deb file and looks to be the right size.

btullis@apt1001:~$ dpkg -c conda-analytics-0.0.14_amd64.deb | grep spark-network-shuffle
-rw-rw-r-- root/root    127362 2021-05-29 01:27 ./opt/conda-analytics/lib/python3.10/site-packages/pyspark/jars/spark-network-shuffle_2.12-3.1.2.jar
-rw-rw-r-- root/root    127362 2021-05-29 01:27 ./opt/conda-analytics/pkgs/pyspark-3.1.2-pyh6c4a22f_0/site-packages/pyspark/jars/spark-network-shuffle_2.12-3.1.2.jar

All looks good.

Uploading the new deb file.

btullis@apt1001:~$ sudo -i reprepro includedeb buster-wikimedia `pwd`/conda-analytics-0.0.14_amd64.deb
Exporting indices...
btullis@apt1001:~$ sudo -i reprepro includedeb bullseye-wikimedia `pwd`/conda-analytics-0.0.14_amd64.deb
Exporting indices...
Deleting files no longer referenced...

Oh dear, there is still an issue with the version number within the package metadata.

btullis@apt1001:~$ sudo -i reprepro ls conda-analytics
conda-analytics | 0.15 |   buster-wikimedia | amd64
conda-analytics | 0.15 | bullseye-wikimedia | amd64

I'm reverting the version 0.0.14 release, deleting the v0.0.14 tag and re-running the pipeline to create it, now that I understand a little more about the release process.
Technically, perhaps I should have rolled it forward to 0.0.15 and left this error in the history, but I don't think it's necessary in this case.

I am now about to install conda-analytics version 0.0.15 on an-test-worker1001.

Pulled it from GitLab to apt1001

btullis@apt1001:~$ wget https://gitlab.wikimedia.org/api/v4/projects/359/packages/generic/conda-analytics/0.0.15/conda-analytics-0.0.15_amd64.deb
--2023-05-18 13:49:14--  https://gitlab.wikimedia.org/api/v4/projects/359/packages/generic/conda-analytics/0.0.15/conda-analytics-0.0.15_amd64.deb
Resolving gitlab.wikimedia.org (gitlab.wikimedia.org)... 2620:0:861:2:208:80:154:145, 208.80.154.145
Connecting to gitlab.wikimedia.org (gitlab.wikimedia.org)|2620:0:861:2:208:80:154:145|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 951354940 (907M) [application/octet-stream]
Saving to: ‘conda-analytics-0.0.15_amd64.deb’

conda-analytics-0.0.15_amd64.deb                     100%[=====================================================================================================================>] 907.28M   109MB/s    in 8.6s    

2023-05-18 13:49:23 (106 MB/s) - ‘conda-analytics-0.0.15_amd64.deb’ saved [951354940/951354940]

Checked the metadata this time. It looks correct.

btullis@apt1001:~$ dpkg-deb --info conda-analytics-0.0.15_amd64.deb 
 new Debian package, version 2.0.
 size 951354940 bytes: control archive=940 bytes.
     570 bytes,    13 lines      control              
      49 bytes,     1 lines      files                
     645 bytes,    19 lines   *  postinst             #!/usr/bin/env
 Package: conda-analytics
 Version: 0.0.15
 Architecture: amd64
 Maintainer: Aqu (WMF) <aquhen@wikimedia.org>
 Installed-Size: 3347080
 Depends: bash, default-jre-headless | java8-runtime-headless, libsasl2-2, libmariadb-dev
 Section: python
 Priority: optional
 Homepage: https://gitlab.wikimedia.org/repos/data-engineering/conda-analytics
 Description: conda packed environment with pyspark for WMF
  This package contains the standalone environment conda-analytics.
  This package is intended to be installed across the analytics cluster to provide Spark 3 and other
  libraries.

The reprepro command to add it doesn't work because it would downgrade the version.

btullis@apt1001:~$ sudo -i reprepro includedeb buster-wikimedia `pwd`/conda-analytics-0.0.15_amd64.deb
Skipping inclusion of 'conda-analytics' '0.0.15' in 'buster-wikimedia|main|amd64', as it has already '0.15'.
Deleting files just added to the pool but not used.
(to avoid use --keepunusednewfiles next time)

I will see what steps are best to take here. Maybe removing version the incorrect 0.15 version first is the best thing, or maybe there's a simple option to downgrade.

After checking with SRE-infrastructure-foundations the advice was to remove and then re-add to downgrade a version, so I did that.




btullis@apt1001:~$ sudo -i reprepro remove buster-wikimedia conda-analytics
Exporting indices...
btullis@apt1001:~$ sudo -i reprepro remove bullseye-wikimedia conda-analytics
Exporting indices...
Deleting files no longer referenced...
btullis@apt1001:~$ sudo -i reprepro includedeb buster-wikimedia `pwd`/conda-analytics-0.0.15_amd64.deb
Exporting indices...
btullis@apt1001:~$ sudo -i reprepro includedeb bullseye-wikimedia `pwd`/conda-analytics-0.0.15_amd64.deb
Exporting indices...

The version number is now reported correctly

btullis@apt1001:~$ sudo -i reprepro ls conda-analytics
conda-analytics | 0.0.15 |   buster-wikimedia | amd64
conda-analytics | 0.0.15 | bullseye-wikimedia | amd64

Mentioned in SAL (#wikimedia-analytics) [2023-05-18T16:53:24Z] <btullis> installing conda-analytics 0.0.15 to an-test-worker1001 for T332765

So far, so good. We now have the jar available on a test host.

btullis@an-test-worker1001:~$ find /usr/lib/spark3/jars/|grep shuf
/usr/lib/spark3/jars/spark-network-shuffle_2.12-3.1.2.jar

I'll revisit https://gerrit.wikimedia.org/r/c/operations/puppet/+/901604 and adapt it so that just this test worker uses the spark3 shuffler for now.

Uff! I've made a fundamental error. The jar file that I've included in conda-analytics isn't the right one.

I've added:
*spark-network-shuffle_2.12-3.1.2.jar
...instead of the file that we need, which is
*spark-3.1.2-yarn-shuffle.jar

The spark-3.12-yarn-shuffle.jardoesn't appear to be hosted on Maven Central at all, or anywhere else convenient.

This means that there are only two main ways to get this jar file:

  1. Extract if trom a pre-built binary distributions of spark3 from https://archive.apache.org/dist/spark/spark-3.1.2/ - of which there are three versions:
    • spark-3.1.2-bin-hadoop2.7.tgz
    • spark-3.1.2-bin-hadoop3.2.tgz
    • spark-3.1.2-bin-without-hadoop.tgz
  2. Build it ourselves

I'm tempted to explore the second option first, because we already have a working build process for spark3 in the production-images repository. We already build the spark3 yarn shuffler, but currently it's only version 3.3.

Here we can see that the file is already present in the intermediate build container.

btullis@marlin:~$ docker run -it --entrypoint=/bin/bash docker-registry.wikimedia.org/spark-build:3.3.0-2 
root@30a7e09d65e1:/usr/src/spark# ls -l /usr/src/spark/common/network-yarn/target/scala-2.12
total 11008
drwxr-xr-x 4 root root     4096 Nov  4  2022 classes
-rw-r--r-- 1 root root 11263760 Nov  4  2022 spark-3.3.0-yarn-shuffle.jar
drwxr-xr-x 3 root root     4096 Nov  4  2022 test-classes

I don't think that it will take much work to build a spark 3.1.2 container and include this jar. Then we can copy this jar to conda-analytics.

I'm making reasonable progress on building a version of the spark 3.1.2 container, with the required spark-3.1.2-yarn-shuffle.jar file.

Change 922082 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/docker-images/production-images@master] Downgrade the version of spark to 3.1.2

https://gerrit.wikimedia.org/r/922082

I have now completed the patch to build a container of spark 3.1.2
https://gerrit.wikimedia.org/r/c/operations/docker-images/production-images/+/922082

I could have set up separate subtrees for version 3.3 and 3.1, but it would have been more complicated as I would have had to have changed the image name.
Therefore I have simply downgraded it from 3.3.0 to 3.1.2 and addressed a couple of build failures.

Given that we don't generally remove old docker images from our registry, this seems fine to me.
I have also verified from my local build that the correct file is present.

btullis@marlin:~/wmf/production-images$ docker run -it --entrypoint=/bin/bash docker-registry.wikimedia.org/spark-build:3.1.2-1
root@4b8661cbcb7f:/usr/src/spark# ls -l /usr/src/spark/common/network-yarn/target/scala-2.12/spark-3.1.2-yarn-shuffle.jar 
-rw-r--r-- 1 root root 10960048 May 22 09:52 /usr/src/spark/common/network-yarn/target/scala-2.12/spark-3.1.2-yarn-shuffle.jar

Change 922082 merged by Btullis:

[operations/docker-images/production-images@master] Downgrade the version of spark to 3.1.2

https://gerrit.wikimedia.org/r/922082

I'm now building the spark:3.1.2 images.

root@build2001:/srv/images/production-images# build-production-images 
== Step 0: scanning /srv/images/production-images/images ==
Will build the following images:
* docker-registry.discovery.wmnet/spark-build:3.1.2-1
* docker-registry.discovery.wmnet/spark:3.1.2-1
* docker-registry.discovery.wmnet/spark-operator:1.3.7-3.1.2-1
== Step 1: building images ==

Images successfully published:

== Step 2: publishing ==
Successfully published image docker-registry.discovery.wmnet/spark:3.1.2-1
Successfully published image docker-registry.discovery.wmnet/spark-build:3.1.2-1
Successfully published image docker-registry.discovery.wmnet/spark-operator:1.3.7-3.1.2-1

I'll not try to test the changes in https://gitlab.wikimedia.org/repos/data-engineering/conda-analytics/-/merge_requests/27 locally.

This seems to be working as expected. I had to make a new build stage at the beginning of the multi-stage build in order to set up the external docker image as a source, but that is working.

image.png (936×1 px, 298 KB)

I made another mistake. I wanted to check that spark-3.1.2-yarn-shuffle.jar was in fact in the conda-analytics 0.0.16 deb file.

btullis@apt1001:~$ dpkg -c conda-analytics-0.0.16_amd64.deb | grep shuffle
-rw-r--r-- root/root     24813 2023-05-22 15:22 ./opt/conda-analytics/lib/python3.10/site-packages/pyspark/__pycache__/shuffle.cpython-310.pyc
-rw-rw-r-- root/root    127362 2021-05-29 01:27 ./opt/conda-analytics/lib/python3.10/site-packages/pyspark/jars/spark-network-shuffle_2.12-3.1.2.jar
-rw-rw-r-- root/root     27959 2021-05-29 01:27 ./opt/conda-analytics/lib/python3.10/site-packages/pyspark/shuffle.py
-rw-rw-r-- root/root    127362 2021-05-29 01:27 ./opt/conda-analytics/pkgs/pyspark-3.1.2-pyh6c4a22f_0/site-packages/pyspark/jars/spark-network-shuffle_2.12-3.1.2.jar
-rw-rw-r-- root/root     27959 2021-05-29 01:27 ./opt/conda-analytics/pkgs/pyspark-3.1.2-pyh6c4a22f_0/site-packages/pyspark/shuffle.py
btullis@apt1001:~$

It was not :-(

I realised that what I had done was to copy it to a file named /opt/miniconda/envs/conda_dist_env/lib/python${PYTHON_MAJOR_VERSION}/site-packages/pyspark/yarn instead of a directory with that name.

Verified with:

btullis@apt1001:~$ dpkg-deb -x conda-analytics-0.0.16_amd64.deb .
btullis@apt1001:~$ file opt/conda-analytics/lib/python3.10/site-packages/pyspark/yarn 
opt/conda-analytics/lib/python3.10/site-packages/pyspark/yarn: Java archive data (JAR)

I should probably have made a .deb file of a dev version before cutting a release, but it looks like I will now have to make a 0.0.17 release with this fix. At least I'm a little more familiar with the release process for conda-analytics now :-)

Mentioned in SAL (#wikimedia-analytics) [2023-05-22T22:12:23Z] <btullis> installing conda-analytics-0.0.17.dev_amd64.deb to an-test-client1001 for T332765

OK, this time I have built a debian package first and checked the contents, rather than releasing first.
Looks OK to me.

btullis@an-test-client1001:~$ dpkg-deb -c conda-analytics-0.0.17.dev_amd64.deb |grep spark-3.1.2-yarn-shuffle
-rw-r--r-- root/root  10960048 2023-05-22 12:11 ./opt/conda-analytics/lib/python3.10/site-packages/pyspark/yarn/spark-3.1.2-yarn-shuffle.jar

I'm installing it with:

btullis@an-test-client1001:~$ sudo dpkg -i conda-analytics-0.0.17.dev_amd64.deb 
(Reading database ... 644770 files and directories currently installed.)
Preparing to unpack conda-analytics-0.0.17.dev_amd64.deb ...
Unpacking conda-analytics (0.0.17) over (0.0.13) ...

Mentioned in SAL (#wikimedia-analytics) [2023-05-23T08:22:16Z] <btullis> installing conda-analytics-0.0.17.dev_amd64.deb to an-test-worker1001 for T332765

Change 922483 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Fix quoting in the spark3_yarn_shuffle_jar_install.sh script

https://gerrit.wikimedia.org/r/922483

Change 922483 merged by Btullis:

[operations/puppet@production] Fix quoting in the spark3_yarn_shuffle_jar_install.sh script

https://gerrit.wikimedia.org/r/922483

Change 922484 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Re-enable an-test-worker1001 in the analytics_test_cluster

https://gerrit.wikimedia.org/r/922484

Change 922484 merged by Btullis:

[operations/puppet@production] Re-enable an-test-worker1001 in the analytics_test_cluster

https://gerrit.wikimedia.org/r/922484

Success! We got a clean puppet run on an-test-worker1001. The hadoop-yarn-nodemanager service started, with the spark3 yarn shuffler jar.

btullis@an-test-worker1001:/var/log/hadoop-yarn$ sudo run-puppet-agent
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for an-test-worker1001.eqiad.wmnet
Info: Unable to serialize catalog to json, retrying with pson
Info: Applying configuration version '(c0a1f9a82d) Ben Tullis - Re-enable an-test-worker1001 in the analytics_test_cluster'
Notice: /Stage[main]/Bigtop::Hadoop::Nodemanager/Systemd::Service[hadoop-yarn-nodemanager]/Service[hadoop-yarn-nodemanager]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Bigtop::Hadoop::Nodemanager/Systemd::Service[hadoop-yarn-nodemanager]/Service[hadoop-yarn-nodemanager]: Unscheduling refresh on Service[hadoop-yarn-nodemanager]
Notice: Applied catalog in 57.39 seconds

We also have this entry in the logs.

2023-05-23 10:38:22,074 INFO org.apache.spark.network.yarn.YarnShuffleService: Recovery location is: /tmp/hadoop-yarn/yarn-nm-recovery/nm-aux-services/spark_shuffle/sparkShuffleRecovery.ldb
2023-05-23 10:38:22,074 INFO org.apache.spark.network.yarn.YarnShuffleService: Going to reload spark shuffle data
2023-05-23 10:38:22,238 INFO org.apache.spark.network.yarn.YarnShuffleService: Registered metrics with Hadoop's DefaultMetricsSystem
2023-05-23 10:38:22,239 INFO org.apache.spark.network.yarn.YarnShuffleService: Started YARN shuffle service for Spark on port 7337. Authentication is enabled.  Registered executor file is /tmp/hadoop-yarn/yarn-nm-recovery/nm-aux-services/spark_shuffle/registeredExecutors.ldb

Active nodemanagers has increased from 2 to 3 here.

image.png (953×1 px, 57 KB)

I will cut a new version 0.0.17 of conda-analytics and then add it to apt.wikimedia.org.

Change 922494 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Deploy the spark3 yarn shuffler to the hadoop test workers

https://gerrit.wikimedia.org/r/922494

Change 922494 merged by Btullis:

[operations/puppet@production] Deploy the spark3 yarn shuffler to the hadoop test workers

https://gerrit.wikimedia.org/r/922494

I have released version 0.0.17 of conda-analytics: https://gitlab.wikimedia.org/repos/data-engineering/conda-analytics/-/packages/363
Pulled it to apt1001 with

btullis@apt1001:~$ wget https://gitlab.wikimedia.org/api/v4/projects/359/packages/generic/conda-analytics/0.0.17/conda-analytics-0.0.17_amd64.deb
--2023-05-23 12:06:02--  https://gitlab.wikimedia.org/api/v4/projects/359/packages/generic/conda-analytics/0.0.17/conda-analytics-0.0.17_amd64.deb
Resolving gitlab.wikimedia.org (gitlab.wikimedia.org)... 2620:0:861:2:208:80:154:145, 208.80.154.145
Connecting to gitlab.wikimedia.org (gitlab.wikimedia.org)|2620:0:861:2:208:80:154:145|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 961101516 (917M) [application/octet-stream]
Saving to: ‘conda-analytics-0.0.17_amd64.deb’

conda-analytics-0.0.17_amd64.deb                     100%[=====================================================================================================================>] 916.58M   102MB/s    in 9.3s    

2023-05-23 12:06:12 (98.6 MB/s) - ‘conda-analytics-0.0.17_amd64.deb’ saved [961101516/961101516]

Checked the metadata:

btullis@apt1001:~$ dpkg-deb --info conda-analytics-0.0.17_amd64.deb 
 new Debian package, version 2.0.
 size 961101516 bytes: control archive=940 bytes.
     570 bytes,    13 lines      control              
      49 bytes,     1 lines      files                
     645 bytes,    19 lines   *  postinst             #!/usr/bin/env
 Package: conda-analytics
 Version: 0.0.17
 Architecture: amd64
 Maintainer: Aqu (WMF) <aquhen@wikimedia.org>
 Installed-Size: 3358818
 Depends: bash, default-jre-headless | java8-runtime-headless, libsasl2-2, libmariadb-dev
 Section: python
 Priority: optional
 Homepage: https://gitlab.wikimedia.org/repos/data-engineering/conda-analytics
 Description: conda packed environment with pyspark for WMF
  This package contains the standalone environment conda-analytics.
  This package is intended to be installed across the analytics cluster to provide Spark 3 and other
  libraries.

Added it to the apt repository:

btullis@apt1001:~$ sudo -i reprepro includedeb buster-wikimedia `pwd`/conda-analytics-0.0.17_amd64.deb
Exporting indices...
btullis@apt1001:~$ sudo -i reprepro includedeb bullseye-wikimedia `pwd`/conda-analytics-0.0.17_amd64.deb
Exporting indices...
Deleting files no longer referenced...

Checked the version:

btullis@apt1001:~$ sudo -i reprepro ls conda-analytics
conda-analytics | 0.0.17 |   buster-wikimedia | amd64
conda-analytics | 0.0.17 | bullseye-wikimedia | amd64

I'll now push out this version of conda-analytics to the test-cluster.

Change 922585 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Fix the script to install the spark3 yarn shuffler jar symlink

https://gerrit.wikimedia.org/r/922585

I have discussed the timing of this with the Data-Engineering team and we have decided that we will announce a specific date for the switch-over to the spark3 shuffler.

The reason is that we don't know what the behaviour of the spark3 shuffler will be if spark2 jobs are run on it, but it probably won't be optimal even if it does work.

So we are going to plan to make the switch-over date for the shuffler the same day that we officially deprecate spark2.

In the emantime, I can push out conda-analytics version 0.0.17 to the prod cluster. There are no substantive changes to the conda environment itself, other than the addition of the jar file, so we do not need to announce a maintenance window.

Moving this to waiting, whilst we plan the final deprecation of spark2 and chase down the last users of that version.

BTullis triaged this task as Medium priority.Jun 5 2023, 12:34 PM

I'm pushing out version 0.0.18 of conda-analytics, so the spark3 yarn shuffler jar will be present on all hadoop workers, but it won't be made active yet.

Before we can active the spark 3 shuffler, we need to migrate all jobs to spark 3.

Change 922585 merged by Btullis:

[operations/puppet@production] Fix the script to install the spark3 yarn shuffler jar symlink

https://gerrit.wikimedia.org/r/922585

Change 935425 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Temporarily disable gobblin jobs on the analytics cluster

https://gerrit.wikimedia.org/r/935425

Change 935426 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Temporarily disable the spark jobs that are running on an-launcher1002

https://gerrit.wikimedia.org/r/935426

Change 935427 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Upgrade the spark shuffler service from version 2 to version 3

https://gerrit.wikimedia.org/r/935427

Change 935444 had a related patch set uploaded (by Stevemunene; author: Stevemunene):

[operations/puppet@production] Create spark3 local directory

https://gerrit.wikimedia.org/r/935444

Change 935425 merged by Btullis:

[operations/puppet@production] Temporarily disable gobblin jobs on the analytics cluster

https://gerrit.wikimedia.org/r/935425

Change 935426 merged by Btullis:

[operations/puppet@production] Temporarily disable the spark jobs that are running on an-launcher1002

https://gerrit.wikimedia.org/r/935426

Mentioned in SAL (#wikimedia-analytics) [2023-07-05T08:44:31Z] <btullis> disabled gobblin and spark jobs on an-launcher for T332765

Change 935427 merged by Btullis:

[operations/puppet@production] Upgrade the spark shuffler service from version 2 to version 3

https://gerrit.wikimedia.org/r/935427

The restarted resourcemanagers are looking good so far. Here are some related logs from /var/log/hadoop-yarn/yarn-yarn-nodemanager-an-worker1087.log

2023-07-05 09:12:55,483 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.AuxServices: Adding auxiliary service mapreduce_shuffle, "mapreduce_shuffle"
2023-07-05 09:12:55,986 INFO org.apache.spark.network.yarn.YarnShuffleService: Initializing YARN shuffle service for Spark
2023-07-05 09:12:55,986 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.AuxServices: Adding auxiliary service spark_shuffle, "spark_shuffle"
2023-07-05 09:12:56,227 INFO org.apache.spark.network.shuffle.ExternalShuffleBlockResolver: Reloading registered executors: ExternalShuffleBlockResolver.AppExecId[appId=application_1687442676858_4576,execId=13]
2023-07-05 09:12:56,251 INFO org.apache.spark.network.yarn.YarnShuffleService: Recovery location is: /tmp/hadoop-yarn/yarn-nm-recovery/nm-aux-services/spark_shuffle/sparkShuffleRecovery.ldb
2023-07-05 09:12:56,251 INFO org.apache.spark.network.yarn.YarnShuffleService: Going to reload spark shuffle data
2023-07-05 09:12:56,460 INFO org.apache.spark.network.yarn.YarnShuffleService: Registered metrics with Hadoop's DefaultMetricsSystem
2023-07-05 09:12:56,461 INFO org.apache.spark.network.yarn.YarnShuffleService: Started YARN shuffle service for Spark on port 7337. Authentication is enabled.  Registered executor file is /tmp/hadoop-yarn/yarn-nm-recovery/nm-aux-services/spark_shuffle/registeredExecutors.ldb
2023-07-05 09:12:57,079 INFO org.apache.hadoop.mapred.ShuffleHandler: Using state database at /tmp/hadoop-yarn/yarn-nm-recovery/nm-aux-services/mapreduce_shuffle/mapreduce_shuffle_state for recovery
2023-07-05 09:12:57,088 INFO org.apache.hadoop.mapred.ShuffleHandler: Loaded state DB schema version info 1.0
2023-07-05 09:12:57,141 INFO org.apache.hadoop.mapred.ShuffleHandler: Encrypted shuffle is enabled.
2023-07-05 09:12:57,380 INFO org.apache.hadoop.mapred.ShuffleHandler: mapreduce_shuffle listening on port 13562
2023-07-05 09:13:13,628 INFO org.apache.spark.network.yarn.YarnShuffleService: Initializing container container_e85_1687442676858_94965_03_000007
2023-07-05 09:13:13,628 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.AuxServices: Got APPLICATION_INIT for service spark_shuffle

Change 935491 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Revert "Temporarily disable the spark jobs that are running on an-launcher1002"

https://gerrit.wikimedia.org/r/935491

Change 935491 merged by Btullis:

[operations/puppet@production] Revert "Temporarily disable the spark jobs that are running on an-launcher1002"

https://gerrit.wikimedia.org/r/935491

Change 935690 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Configure spark3 defaults to use the new fetch protocol

https://gerrit.wikimedia.org/r/935690

Change 935492 had a related patch set uploaded (by Btullis; author: Btullis):

[operations/puppet@production] Revert "Temporarily disable gobblin jobs on the analytics cluster"

https://gerrit.wikimedia.org/r/935492

Change 935492 merged by Btullis:

[operations/puppet@production] Revert "Temporarily disable gobblin jobs on the analytics cluster"

https://gerrit.wikimedia.org/r/935492

So far, everything looks good. I have created a patch to update the spark3-defaults by removing the compatibility option for the spark2 shuffler service.

Change 935690 merged by Btullis:

[operations/puppet@production] Configure spark3 defaults to use the new fetch protocol

https://gerrit.wikimedia.org/r/935690

Mentioned in SAL (#wikimedia-analytics) [2023-07-05T10:20:25Z] <btullis> deploying updated spark3 defaults to disable the spark.shuffle.useOldFetchProtocoloption for T332765

Change 935444 merged by Stevemunene:

[operations/puppet@production] Create spark3 local directory

https://gerrit.wikimedia.org/r/935444