We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Upgrade cloudpickle to > 2.0.0
Hello,

One of the features of pipelines is Step Caching (https://www.kubeflow.org/docs/components/pipelines/caching/) to avoid running the costly computations again and again. 

The key for caching is:

```
message CacheKey {
  map<string, ArtifactNameList> inputArtifactNames = 1;
  map<string, Value> inputParameters = 2;
  map<string, RuntimeArtifact> outputArtifactsSpec = 3;
  map<string, string> outputParametersSpec=4;
  ContainerSpec containerSpec=5;
}
```

When using the option `use_code_pickling` from https://github.com/kubeflow/pipelines/blob/74c7773ca40decfd0d4ed40dc93a6af591bbc190/sdk/python/kfp/components/_python_op.py#L516

the pickle of the function gets embedded in the `ContainerSpec` (and hence becomes part of the key). 

So far, all good. 

However, the pickle is generated with `cloudpickle` which leads to non deterministic pickles every time you run the pipeline. As you can imagine, this makes caching feature useless because it will invalidate the cache every time it is run.

This non determinism was removed from `cloudpickle` with the following commit:
https://github.com/cloudpipe/cloudpickle/pull/428 and released as part of `2.0.0` release:
https://github.com/cloudpipe/cloudpickle/releases/tag/v2.0.0

Currently, `kfp` has bounded cloudpickle to less than v2.0.0 here:
https://github.com/kubeflow/pipelines/blob/74c7773ca40decfd0d4ed40dc93a6af591bbc190/sdk/python/setup.py#L37


Would it be possible to make a new `kfp` release with upgraded cloudpickle? Without this cloudpickle version, step caching is currently impossible to use (or at the mercy of dictionary insertion order of cloudpickle). 

Thanks!

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sdk/python/setup.py`
Content:
```
1 # Copyright 2018 The Kubeflow Authors
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import os
16 import re
17 
18 from setuptools import setup
19 
20 NAME = 'kfp'
21 #VERSION = .... Change the version in kfp/__init__.py
22 
23 # NOTICE, after any updates to the following, ./requirements.in should be updated
24 # accordingly.
25 REQUIRES = [
26     'absl-py>=0.9,<=0.11',
27     'PyYAML>=5.3,<6',
28     # `Blob.from_string` was introduced in google-cloud-storage 1.20.0
29     # https://github.com/googleapis/python-storage/blob/master/CHANGELOG.md#1200
30     'google-cloud-storage>=1.20.0,<2',
31     'kubernetes>=8.0.0,<19',
32     # google-api-python-client v2 doesn't work for private dicovery by default:
33     # https://github.com/googleapis/google-api-python-client/issues/1225#issuecomment-791058235
34     'google-api-python-client>=1.7.8,<2',
35     'google-auth>=1.6.1,<2',
36     'requests-toolbelt>=0.8.0,<1',
37     'cloudpickle>=1.3.0,<2',
38     # Update the upper version whenever a new major version of the
39     # kfp-server-api package is released.
40     # Update the lower version when kfp sdk depends on new apis/fields in
41     # kfp-server-api.
42     # Note, please also update ./requirements.in
43     'kfp-server-api>=1.1.2,<2.0.0',
44     'jsonschema>=3.0.1,<4',
45     'tabulate>=0.8.6,<1',
46     'click>=7.1.2,<9',
47     'Deprecated>=1.2.7,<2',
48     'strip-hints>=0.1.8,<1',
49     'docstring-parser>=0.7.3,<1',
50     'kfp-pipeline-spec>=0.1.10,<0.2.0',
51     'fire>=0.3.1,<1',
52     'protobuf>=3.13.0,<4',
53     'uritemplate>=3.0.1,<4',
54     'pydantic>=1.8.2,<2',
55     # Standard library backports
56     'dataclasses;python_version<"3.7"',
57     'typing-extensions>=3.7.4,<4;python_version<"3.9"',
58 ]
59 
60 TESTS_REQUIRE = [
61     'frozendict',
62 ]
63 
64 
65 def find_version(*file_path_parts):
66     here = os.path.abspath(os.path.dirname(__file__))
67     with open(os.path.join(here, *file_path_parts), 'r') as fp:
68         version_file_text = fp.read()
69 
70     version_match = re.search(
71         r"^__version__ = ['\"]([^'\"]*)['\"]",
72         version_file_text,
73         re.M,
74     )
75     if version_match:
76         return version_match.group(1)
77 
78     raise RuntimeError('Unable to find version string.')
79 
80 
81 setup(
82     name=NAME,
83     version=find_version('kfp', '__init__.py'),
84     description='KubeFlow Pipelines SDK',
85     author='The Kubeflow Authors',
86     url="https://github.com/kubeflow/pipelines",
87     project_urls={
88         "Documentation": "https://kubeflow-pipelines.readthedocs.io/en/stable/",
89         "Bug Tracker": "https://github.com/kubeflow/pipelines/issues",
90         "Source": "https://github.com/kubeflow/pipelines/tree/master/sdk",
91         "Changelog": "https://github.com/kubeflow/pipelines/blob/master/sdk/RELEASE.md",
92     },
93     install_requires=REQUIRES,
94     tests_require=TESTS_REQUIRE,
95     packages=[
96         'kfp',
97         'kfp.auth',
98         'kfp.cli',
99         'kfp.cli.diagnose_me',
100         'kfp.compiler',
101         'kfp.components',
102         'kfp.components.structures',
103         'kfp.containers',
104         'kfp.dsl',
105         'kfp.dsl.extensions',
106         'kfp.notebook',
107         'kfp.v2',
108         'kfp.v2.compiler',
109         'kfp.v2.components',
110         'kfp.v2.components.types',
111         'kfp.v2.components.experimental',
112         'kfp.v2.dsl',
113         'kfp.v2.google.client',
114         'kfp.v2.google.experimental',
115     ],
116     classifiers=[
117         'Intended Audience :: Developers',
118         'Intended Audience :: Education',
119         'Intended Audience :: Science/Research',
120         'License :: OSI Approved :: Apache Software License',
121         'Programming Language :: Python :: 3',
122         'Programming Language :: Python :: 3.6',
123         'Programming Language :: Python :: 3.7',
124         'Programming Language :: Python :: 3.8',
125         'Programming Language :: Python :: 3.9',
126         'Topic :: Scientific/Engineering',
127         'Topic :: Scientific/Engineering :: Artificial Intelligence',
128         'Topic :: Software Development',
129         'Topic :: Software Development :: Libraries',
130         'Topic :: Software Development :: Libraries :: Python Modules',
131     ],
132     python_requires='>=3.6.1',
133     include_package_data=True,
134     entry_points={
135         'console_scripts': [
136             'dsl-compile = kfp.compiler.main:main',
137             'dsl-compile-v2 = kfp.v2.compiler.main:main',
138             'kfp=kfp.__main__:main'
139         ]
140     })
141
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/sdk/python/setup.py b/sdk/python/setup.py
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -34,7 +34,7 @@
     'google-api-python-client>=1.7.8,<2',
     'google-auth>=1.6.1,<2',
     'requests-toolbelt>=0.8.0,<1',
-    'cloudpickle>=1.3.0,<2',
+    'cloudpickle>=2.0.0,<3',
     # Update the upper version whenever a new major version of the
     # kfp-server-api package is released.
     # Update the lower version when kfp sdk depends on new apis/fields in

{"golden_diff": "diff --git a/sdk/python/setup.py b/sdk/python/setup.py\n--- a/sdk/python/setup.py\n+++ b/sdk/python/setup.py\n@@ -34,7 +34,7 @@\n     'google-api-python-client>=1.7.8,<2',\n     'google-auth>=1.6.1,<2',\n     'requests-toolbelt>=0.8.0,<1',\n-    'cloudpickle>=1.3.0,<2',\n+    'cloudpickle>=2.0.0,<3',\n     # Update the upper version whenever a new major version of the\n     # kfp-server-api package is released.\n     # Update the lower version when kfp sdk depends on new apis/fields in\n", "issue": "Upgrade cloudpickle to > 2.0.0\nHello,\r\n\r\nOne of the features of pipelines is Step Caching (https://www.kubeflow.org/docs/components/pipelines/caching/) to avoid running the costly computations again and again. \r\n\r\nThe key for caching is:\r\n\r\n```\r\nmessage CacheKey {\r\n  map<string, ArtifactNameList> inputArtifactNames = 1;\r\n  map<string, Value> inputParameters = 2;\r\n  map<string, RuntimeArtifact> outputArtifactsSpec = 3;\r\n  map<string, string> outputParametersSpec=4;\r\n  ContainerSpec containerSpec=5;\r\n}\r\n```\r\n\r\nWhen using the option `use_code_pickling` from https://github.com/kubeflow/pipelines/blob/74c7773ca40decfd0d4ed40dc93a6af591bbc190/sdk/python/kfp/components/_python_op.py#L516\r\n\r\nthe pickle of the function gets embedded in the `ContainerSpec` (and hence becomes part of the key). \r\n\r\nSo far, all good. \r\n\r\nHowever, the pickle is generated with `cloudpickle` which leads to non deterministic pickles every time you run the pipeline. As you can imagine, this makes caching feature useless because it will invalidate the cache every time it is run.\r\n\r\nThis non determinism was removed from `cloudpickle` with the following commit:\r\nhttps://github.com/cloudpipe/cloudpickle/pull/428 and released as part of `2.0.0` release:\r\nhttps://github.com/cloudpipe/cloudpickle/releases/tag/v2.0.0\r\n\r\nCurrently, `kfp` has bounded cloudpickle to less than v2.0.0 here:\r\nhttps://github.com/kubeflow/pipelines/blob/74c7773ca40decfd0d4ed40dc93a6af591bbc190/sdk/python/setup.py#L37\r\n\r\n\r\nWould it be possible to make a new `kfp` release with upgraded cloudpickle? Without this cloudpickle version, step caching is currently impossible to use (or at the mercy of dictionary insertion order of cloudpickle). \r\n\r\nThanks!\n", "before_files": [{"content": "# Copyright 2018 The Kubeflow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport re\n\nfrom setuptools import setup\n\nNAME = 'kfp'\n#VERSION = .... Change the version in kfp/__init__.py\n\n# NOTICE, after any updates to the following, ./requirements.in should be updated\n# accordingly.\nREQUIRES = [\n    'absl-py>=0.9,<=0.11',\n    'PyYAML>=5.3,<6',\n    # `Blob.from_string` was introduced in google-cloud-storage 1.20.0\n    # https://github.com/googleapis/python-storage/blob/master/CHANGELOG.md#1200\n    'google-cloud-storage>=1.20.0,<2',\n    'kubernetes>=8.0.0,<19',\n    # google-api-python-client v2 doesn't work for private dicovery by default:\n    # https://github.com/googleapis/google-api-python-client/issues/1225#issuecomment-791058235\n    'google-api-python-client>=1.7.8,<2',\n    'google-auth>=1.6.1,<2',\n    'requests-toolbelt>=0.8.0,<1',\n    'cloudpickle>=1.3.0,<2',\n    # Update the upper version whenever a new major version of the\n    # kfp-server-api package is released.\n    # Update the lower version when kfp sdk depends on new apis/fields in\n    # kfp-server-api.\n    # Note, please also update ./requirements.in\n    'kfp-server-api>=1.1.2,<2.0.0',\n    'jsonschema>=3.0.1,<4',\n    'tabulate>=0.8.6,<1',\n    'click>=7.1.2,<9',\n    'Deprecated>=1.2.7,<2',\n    'strip-hints>=0.1.8,<1',\n    'docstring-parser>=0.7.3,<1',\n    'kfp-pipeline-spec>=0.1.10,<0.2.0',\n    'fire>=0.3.1,<1',\n    'protobuf>=3.13.0,<4',\n    'uritemplate>=3.0.1,<4',\n    'pydantic>=1.8.2,<2',\n    # Standard library backports\n    'dataclasses;python_version<\"3.7\"',\n    'typing-extensions>=3.7.4,<4;python_version<\"3.9\"',\n]\n\nTESTS_REQUIRE = [\n    'frozendict',\n]\n\n\ndef find_version(*file_path_parts):\n    here = os.path.abspath(os.path.dirname(__file__))\n    with open(os.path.join(here, *file_path_parts), 'r') as fp:\n        version_file_text = fp.read()\n\n    version_match = re.search(\n        r\"^__version__ = ['\\\"]([^'\\\"]*)['\\\"]\",\n        version_file_text,\n        re.M,\n    )\n    if version_match:\n        return version_match.group(1)\n\n    raise RuntimeError('Unable to find version string.')\n\n\nsetup(\n    name=NAME,\n    version=find_version('kfp', '__init__.py'),\n    description='KubeFlow Pipelines SDK',\n    author='The Kubeflow Authors',\n    url=\"https://github.com/kubeflow/pipelines\",\n    project_urls={\n        \"Documentation\": \"https://kubeflow-pipelines.readthedocs.io/en/stable/\",\n        \"Bug Tracker\": \"https://github.com/kubeflow/pipelines/issues\",\n        \"Source\": \"https://github.com/kubeflow/pipelines/tree/master/sdk\",\n        \"Changelog\": \"https://github.com/kubeflow/pipelines/blob/master/sdk/RELEASE.md\",\n    },\n    install_requires=REQUIRES,\n    tests_require=TESTS_REQUIRE,\n    packages=[\n        'kfp',\n        'kfp.auth',\n        'kfp.cli',\n        'kfp.cli.diagnose_me',\n        'kfp.compiler',\n        'kfp.components',\n        'kfp.components.structures',\n        'kfp.containers',\n        'kfp.dsl',\n        'kfp.dsl.extensions',\n        'kfp.notebook',\n        'kfp.v2',\n        'kfp.v2.compiler',\n        'kfp.v2.components',\n        'kfp.v2.components.types',\n        'kfp.v2.components.experimental',\n        'kfp.v2.dsl',\n        'kfp.v2.google.client',\n        'kfp.v2.google.experimental',\n    ],\n    classifiers=[\n        'Intended Audience :: Developers',\n        'Intended Audience :: Education',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: Apache Software License',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Topic :: Scientific/Engineering',\n        'Topic :: Scientific/Engineering :: Artificial Intelligence',\n        'Topic :: Software Development',\n        'Topic :: Software Development :: Libraries',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n    python_requires='>=3.6.1',\n    include_package_data=True,\n    entry_points={\n        'console_scripts': [\n            'dsl-compile = kfp.compiler.main:main',\n            'dsl-compile-v2 = kfp.v2.compiler.main:main',\n            'kfp=kfp.__main__:main'\n        ]\n    })\n", "path": "sdk/python/setup.py"}], "after_files": [{"content": "# Copyright 2018 The Kubeflow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport os\nimport re\n\nfrom setuptools import setup\n\nNAME = 'kfp'\n#VERSION = .... Change the version in kfp/__init__.py\n\n# NOTICE, after any updates to the following, ./requirements.in should be updated\n# accordingly.\nREQUIRES = [\n    'absl-py>=0.9,<=0.11',\n    'PyYAML>=5.3,<6',\n    # `Blob.from_string` was introduced in google-cloud-storage 1.20.0\n    # https://github.com/googleapis/python-storage/blob/master/CHANGELOG.md#1200\n    'google-cloud-storage>=1.20.0,<2',\n    'kubernetes>=8.0.0,<19',\n    # google-api-python-client v2 doesn't work for private dicovery by default:\n    # https://github.com/googleapis/google-api-python-client/issues/1225#issuecomment-791058235\n    'google-api-python-client>=1.7.8,<2',\n    'google-auth>=1.6.1,<2',\n    'requests-toolbelt>=0.8.0,<1',\n    'cloudpickle>=2.0.0,<3',\n    # Update the upper version whenever a new major version of the\n    # kfp-server-api package is released.\n    # Update the lower version when kfp sdk depends on new apis/fields in\n    # kfp-server-api.\n    # Note, please also update ./requirements.in\n    'kfp-server-api>=1.1.2,<2.0.0',\n    'jsonschema>=3.0.1,<4',\n    'tabulate>=0.8.6,<1',\n    'click>=7.1.2,<9',\n    'Deprecated>=1.2.7,<2',\n    'strip-hints>=0.1.8,<1',\n    'docstring-parser>=0.7.3,<1',\n    'kfp-pipeline-spec>=0.1.10,<0.2.0',\n    'fire>=0.3.1,<1',\n    'protobuf>=3.13.0,<4',\n    'uritemplate>=3.0.1,<4',\n    'pydantic>=1.8.2,<2',\n    # Standard library backports\n    'dataclasses;python_version<\"3.7\"',\n    'typing-extensions>=3.7.4,<4;python_version<\"3.9\"',\n]\n\nTESTS_REQUIRE = [\n    'frozendict',\n]\n\n\ndef find_version(*file_path_parts):\n    here = os.path.abspath(os.path.dirname(__file__))\n    with open(os.path.join(here, *file_path_parts), 'r') as fp:\n        version_file_text = fp.read()\n\n    version_match = re.search(\n        r\"^__version__ = ['\\\"]([^'\\\"]*)['\\\"]\",\n        version_file_text,\n        re.M,\n    )\n    if version_match:\n        return version_match.group(1)\n\n    raise RuntimeError('Unable to find version string.')\n\n\nsetup(\n    name=NAME,\n    version=find_version('kfp', '__init__.py'),\n    description='KubeFlow Pipelines SDK',\n    author='The Kubeflow Authors',\n    url=\"https://github.com/kubeflow/pipelines\",\n    project_urls={\n        \"Documentation\": \"https://kubeflow-pipelines.readthedocs.io/en/stable/\",\n        \"Bug Tracker\": \"https://github.com/kubeflow/pipelines/issues\",\n        \"Source\": \"https://github.com/kubeflow/pipelines/tree/master/sdk\",\n        \"Changelog\": \"https://github.com/kubeflow/pipelines/blob/master/sdk/RELEASE.md\",\n    },\n    install_requires=REQUIRES,\n    tests_require=TESTS_REQUIRE,\n    packages=[\n        'kfp',\n        'kfp.auth',\n        'kfp.cli',\n        'kfp.cli.diagnose_me',\n        'kfp.compiler',\n        'kfp.components',\n        'kfp.components.structures',\n        'kfp.containers',\n        'kfp.dsl',\n        'kfp.dsl.extensions',\n        'kfp.notebook',\n        'kfp.v2',\n        'kfp.v2.compiler',\n        'kfp.v2.components',\n        'kfp.v2.components.types',\n        'kfp.v2.components.experimental',\n        'kfp.v2.dsl',\n        'kfp.v2.google.client',\n        'kfp.v2.google.experimental',\n    ],\n    classifiers=[\n        'Intended Audience :: Developers',\n        'Intended Audience :: Education',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: Apache Software License',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Topic :: Scientific/Engineering',\n        'Topic :: Scientific/Engineering :: Artificial Intelligence',\n        'Topic :: Software Development',\n        'Topic :: Software Development :: Libraries',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n    python_requires='>=3.6.1',\n    include_package_data=True,\n    entry_points={\n        'console_scripts': [\n            'dsl-compile = kfp.compiler.main:main',\n            'dsl-compile-v2 = kfp.v2.compiler.main:main',\n            'kfp=kfp.__main__:main'\n        ]\n    })\n", "path": "sdk/python/setup.py"}]}