Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix container images building on arm64 #3839

Closed
wants to merge 1 commit into from
Closed

Fix container images building on arm64 #3839

wants to merge 1 commit into from

Conversation

MrXinWang
Copy link
Contributor

@MrXinWang MrXinWang commented May 25, 2020

This commit fixes the container images building on arm64, including:

  1. Enabled cache server, visualization server and metadata_envoy containers building on arm64.

  2. Fixed broken api-server build on arm64 by adding a Dockerfile for arm64 as base image. This image will contain some dependancies (tensorflow, pyarrow, tfx-bsl, tensorflow-data-validation, and ml-metadata) which cannot be directly installed by pip on arm.

  3. Updated doc and the building script.

Signed-off-by: Henry Wang [email protected]

@kubeflow-bot
Copy link

This change is Reviewable

@Bobgy
Copy link
Contributor

Bobgy commented May 25, 2020

/assign @jingzhang36 @IronPan
/lgtm

@jingzhang36
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jingzhang36
To complete the pull request process, please assign ironpan
You can assign the PR to them by writing /assign @ironpan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

# As some of the AArch64 dependancies are installed from source,
# running pip freeze will give additional package information after
# an " @", we need to remove that part.
# The license checking on some additional installed packages on AArch64 should also be skipped.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure the license checking should be skipped for those packages? Maybe just add the licenses to the list.

Copy link
Contributor Author

@MrXinWang MrXinWang May 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ark-kun , thanks for your comment. Well, there are two cases for these skipped packages:

  1. As some of the dependancies in the arm64 docker image are built from source, they need Cython to build. However I checked the x86_64 image, Cython is not installed in that image. Therefore Cython is skipped.

  2. The arm64 base image proposed in this PR does not contain some of the required packages, and I have to install them manually by pip from Dockerfile.visualization#L43. This will lead to some additional packages cffi, jeepney, pycairo, pycparser also installed. As x86_64 image also does not have them, these four packages should be skipped.

I think if I add these packages to the license list, the x86_64 building will be broken. So I chose to only skip them for arm64.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if I add these packages to the license list, the x86_64 building will be broken.

That should not be the case. The license script just uses the list to get URLs for the package licenses and downloads licenses for all packages returned by pip freeze.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ark-kun, thanks for your patience.

Yes and no. The license.sh does work as you described. However these 4 packages are only installed in the arm64 image. If their licenses are added to the .csv file. The license.sh will also check the license of these 4 packages on x86_64, and will ask us to install them in x86_64 images, which is unnecessary and break the docker build on x86_64 as shown in license.sh#L84.

Copy link
Contributor

@Ark-kun Ark-kun May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Sorry for my misconception. The license.sh we use for components does not have that part. https://github.com/kubeflow/pipelines/blob/ef73aab59f8fc06db19d5e6f0ca35337e98bcf77/components/license.sh

I think we should remove exit 1 from that script. You can do that.

Copy link
Contributor Author

@MrXinWang MrXinWang May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ark-kun! Thanks, yes that is a solution, however I am worried a little bit about this removing the exit 1....as I personally think it is a little bit too aggressive. Personally I would like to achieve the goal that we can completely encapsulate the arm64 stuff without affecting the x86_64, before we officially support arm64 in kubeflow.

Also I did a quick test about adding the licenses in the .csv file, and it seems if I add them to the csv, I have to run the license-download.sh and also commit these newly downloaded licenses in this PR....Would that be also ok?

If the community is ok with these changes, I am also happy to update this PR with related license changes.

Thanks again for your patience.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried a little bit about this removing the exit 1....as I personally think it is a little bit too aggressive.

I think that the script should fail when there is a missing license. But an extra license is fine in my opinion.

Also I did a quick test about adding the licenses in the .csv file, and it seems if I add them to the csv, I have to run the license-download.sh and also commit these newly downloaded licenses in this PR....Would that be also ok?

I think this would be OK.

I consider it more readable and safe than hacking the license.sh script.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Ark-kun. That would be awesome. I have updated related files in this PR and added everything you suggested. Would you mind taking a look again? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be harder to remove obsolete license files, because we don't know which packages are not needed in x86 but needed in arm, even though the message exists.
Obsolete licenses is not a big issue I agree, just not ideal.

@MrXinWang MrXinWang requested a review from Ark-kun June 1, 2020 08:34
@k8s-ci-robot k8s-ci-robot removed the lgtm label Jun 3, 2020
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@MrXinWang
Copy link
Contributor Author

/retest

This commit fixes the container images building on arm64, including:

1. Enabled cache server, visualization server and metadata_envoy
containers building on arm64.

2. Fixed broken api-server build on arm64 by adding an Dockerfile
for arm64 as base image. This image will contain some dependancies,
including tensorflow, pyarrow, tfx-bsl, tensorflow-data-validation,
and ml-metadata, which cannot be directly installed by pip.

3. Updated doc and building script.

Signed-off-by: Henry Wang <[email protected]>
@stale
Copy link

stale bot commented Sep 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale The issue / pull request is stale, any activities remove this label. label Sep 4, 2020
@stale
Copy link

stale bot commented Sep 11, 2020

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale The issue / pull request is stale, any activities remove this label. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants