Skip to content

Conversation

@chsienki
Copy link
Member

@chsienki chsienki commented Jan 28, 2019

This fixes a couple of related Mono CI things:

  1. Pass --debug on the command line for future debugging:

    • We invoke xunit via arcade, which has limited extensibility points. I've hooked in a target with a bit of quote foo to enable it. It's not very pretty, I'll open a separate bug on Arcade to let us do this in the future more elegantly.
  2. Docker compose caches layers, causing out of date mono builds:

    • We grab mono as part of the docker container build out. If the underlying machines hang around for a while, we'll never rebuild due to caching.
    • This PR adds a dummy arg to the dockerfile that we pass in as current datetime; this allows us to cache up to that point, then always rebuild afterwards (see New feature request: Selectively disable caching for specific RUN commands in Dockerfile moby/moby#1996)
    • We add a new apt-get update/upgrade pair after the dummy arg, so we'll always update mono to the latest regardless of caching, but its much quicker than always rebuilding from scratch
  3. A mono upgrade bug between 5.21 and 5.23 breaks apt-get update:

    • Sadly we hit this bug (Unable to update ca-certificates-mono package mono/mono#12316) upgrading between our cached images and latest
    • For now we need to rebuild docker images from scratch in order to flush out the earlier build from all of our build machines
    • When all the machines in the pool have cycled through we can remove the --no-cache option and just do an incremental update (bullet 2).

@chsienki chsienki added Area-Compilers PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels Jan 28, 2019
@chsienki chsienki added Area-Infrastructure and removed PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels Jan 29, 2019
@chsienki
Copy link
Member Author

@dotnet/roslyn-infrastructure , @agocke , @jaredpar for review please

# Update previously installed mono-devel.
# Cache bust ensures we'll always run the commands following regardless of docker cache status
ARG CACHE_BUST=0
RUN apt-get update && apt-get upgrade -y
Copy link
Member

Choose a reason for hiding this comment

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

Should we restrict this to just mono-devel?

Copy link
Member Author

Choose a reason for hiding this comment

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

Me and @agocke spoke about this yesterday. We figured that we should keep everything up to date as otherwise we could get into weird states where an 'incremental' build fails differently to a new build due to package versioning diffs.

My thinking was to update all, then restrict if we see it taking too long in the future.

Copy link
Member

Choose a reason for hiding this comment

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

Running this in the middle will disable caching for all subsequent statements. Is that what you intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we edit the user permissions to make them match the outer user. That causes the upgrade/update to have issues, so it's simpler to do it before hand. The user stuff takes a trivial amount of time to run, so we aren't hurt by not caching it. (Also, we have no guarantees that the outer user will stay the same, so we'd potentially not want to cache it anyway, although the chance of it changing and the cache remaining seem slim)


In reply to: 251963406 [](ancestors = 251963406)

adding our argument in, then having a second empty quoted argument before the real args. Hmmmmmm.
-->
<PropertyGroup>
<MonoTool>$(MonoTool)" --debug"</MonoTool>
Copy link
Member

Choose a reason for hiding this comment

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

@tmat as we'll need a proper way of doing this at some point.

Copy link
Member

Choose a reason for hiding this comment

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

Can't we set MonoTool to a Bash file that invokes mono with the extra argument?

Copy link
Member Author

Choose a reason for hiding this comment

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

We get the MonoTool path as part of our build script

mono_path=`command -v mono`

So we'd need to dynamically emit that script to a temp path, then pass that in to MSBuild. That seems just as clunky as this?

I'm going to file an issue/PR against arcade to allow add an extensibility point here that we can tap into

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Why? The script can just call mono --debug $@. Mono will then be searched on $PATH

@jaredpar
Copy link
Member

@chsienki

Looks like the docker kill command is wrong:

2019-01-29T00:25:57.5100274Z "docker kill" requires at least 1 argument.
2019-01-29T00:25:57.5101219Z See 'docker kill --help'.
2019-01-29T00:25:57.5101296Z

How can we tell what Mono version got installed here? I can't see the line with the date that you prevously sent in slack.

Note: I'm doing a rebuild of this just to see the effect on the Mono run / caching. Everything passed first time around.

@chsienki
Copy link
Member Author

I'll take a look at the docker kill.

Due to rendering issues between VT and ADO web view the version info doesn't show up, but its there in the log. Download the txt version and search for Mono JIT compiler version


In reply to: 458567955 [](ancestors = 458567955)

Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

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

I think we should file a bug to remove --no-cache when the machines have been cleared.

# Update previously installed mono-devel.
# Cache bust ensures we'll always run the commands following regardless of docker cache status
ARG CACHE_BUST=0
RUN apt-get update && apt-get upgrade -y
Copy link
Member

Choose a reason for hiding this comment

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

Running this in the middle will disable caching for all subsequent statements. Is that what you intended?

@chsienki
Copy link
Member Author

I think the kill command is ok actually. We grab the running PID and pass it to kill, but if it's already exited there's nothing to kill. We || true the kill to carry on regardless, so seems like that was the original intent. We could probably do it better, but seems fine for now.


In reply to: 458654516 [](ancestors = 458654516,458567955)

@chsienki
Copy link
Member Author

I think we should file a bug to remove --no-cache when the machines have been cleared.

Filed #32916

</None>
</ItemGroup>
</Target>

Copy link
Member

Choose a reason for hiding this comment

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

revert?

Copy link
Member

@jaredpar jaredpar left a comment

Choose a reason for hiding this comment

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

:shipit:

@jaredpar jaredpar merged commit 66d31a1 into dotnet:master Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants