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

deps: upgrade libstdc++ to support Autodesk FBX SDK for Unity #163

Merged
merged 3 commits into from
Mar 19, 2022

Conversation

jsm174
Copy link
Contributor

@jsm174 jsm174 commented Mar 13, 2022

Changes

com.autodesk.fbx@4.1 requires libstdc++ 6.0.28+ (see https://docs.unity3d.com/Packages/com.autodesk.fbx@4.1/manual/index.html)

Unfortunately the version of libstdc++ that comes with Ubuntu 18 is 6.0.25. Until the base images are updated to use Ubuntu 20 (which has a much newer version), we need to install an update libstdc++.

I was able to make a docker image:

FROM unityci/editor:2021.2.15f1-linux-il2cpp-0
RUN apt-get update && apt-get -y install software-properties-common && add-apt-repository -y ppa:ubuntu-toolchain-r/test && apt-get -y install --only-upgrade libstdc++6

This was tested at:

freezy/VisualPinball.Engine#387 (comment)

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated or not needed)

@github-actions
Copy link

Cat Gif

@webbertakken
Copy link
Member

We usually only add target-platform-specific additions to editor image. These changes should be made in the base image instead (images/ubuntu/base/Dockerfile).

Could you please give an indication of how much space is used by the base image before and after?

@jsm174 jsm174 force-pushed the misc/upgrade-libstdc++ branch 2 times, most recently from 8fd329d to 8a24114 Compare March 14, 2022 11:46
@jsm174
Copy link
Contributor Author

jsm174 commented Mar 14, 2022

We usually only add target-platform-specific additions to editor image. These changes should be made in the base image instead (images/ubuntu/base/Dockerfile).

Could you please give an indication of how much space is used by the base image before and after?

Thanks. I was going to do base and then I wasn't sure. Reverted the change, and updated accordingly.

As for size, it looks like it's 24mb.

docker images -a unityci/base:ubuntu-latest
REPOSITORY     TAG             IMAGE ID       CREATED       SIZE
unityci/base   ubuntu-latest   841ddfea6757   2 weeks ago   474MB

docker images -a jsm174/unityci_base:ubuntu-latest
REPOSITORY            TAG             IMAGE ID       CREATED         SIZE
jsm174/unityci_base   ubuntu-latest   2b196435d7a1   9 minutes ago   498MB

I feel like more could be cleaned up, but I must be missing something. I added software-properties-common just to get add-apt-repository and then I remove it after installation.

After using dive, it seems like most of the size is in the /var/cache/lib/apt/lists directory:

Screen Shot 2022-03-14 at 8 40 34 AM

@jsm174
Copy link
Contributor Author

jsm174 commented Mar 14, 2022

@webbertakken - I was looking at the editor docker file, and noticed all

apt-get clean are followed by rm -rf /var/lib/apt/lists/*

If we do that here,

docker images -a jsm174/unityci_base:ubuntu-latest
REPOSITORY            TAG             IMAGE ID       CREATED         SIZE
jsm174/unityci_base   ubuntu-latest   c1e5176d1603   6 seconds ago   479MB

The change is ~4MB. We could that for the first block as well and reduce the size of the image as well?

@jsm174
Copy link
Contributor Author

jsm174 commented Mar 14, 2022

Screen Shot 2022-03-14 at 8 59 35 AM

@jsm174
Copy link
Contributor Author

jsm174 commented Mar 16, 2022

Could you please give an indication of how much space is used by the base image before and after?

474MB before, 396MB after. 78MB reduction

@webbertakken
Copy link
Member

webbertakken commented Mar 17, 2022

Could you please give an indication of how much space is used by the base image before and after?

474MB before, 396MB after. 78MB reduction

It's a bit unclear to me how much the size is affected by each change, with both changes in the same MR.
Would you mind applying the suggestion your suggestion in a separate PR:

apt-get clean are followed by rm -rf /var/lib/apt/lists/*

If you could make a screenshot both before and after of the total size of the base image it will be easier to compare (per layer stats aren't very useful).

Then we can rebase this PR and again see the difference of total image size before and after.

@jsm174
Copy link
Contributor Author

jsm174 commented Mar 17, 2022

Sure. Ahh, you were right, only a decrease of about 27mb.

Screen Shot 2022-03-17 at 3 08 57 PM

@webbertakken
Copy link
Member

Context

Tried the changes locally to make a more exact comparison of base image.

  • before is the current version on main.
  • without-lists same as before but with the apt-get lists removed in first 2 RUN instructions
  • without-lists-upgrade-lib same as before but with the lib upgraded

Proof

image

Conclusion

Upgrading the lib in this MR increases size by 4 megs, which is acceptable, as it allows (experimental) unity packages to work out of the box.

@webbertakken webbertakken merged commit cfc2efd into game-ci:main Mar 19, 2022
mob-sakai pushed a commit to mob-sakai/docker that referenced this pull request May 17, 2022
…i#163)

* deps: upgrades libstdc++ to support Autodesk FBX SDK for Unity

* misc: move libstdc++ upgrade from editor to base

* misc: remove /var/lib/apt/lists in base reducing image size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants