Skip to content

ci: use same source everywhere - #2399

Merged
samalba merged 1 commit into
dagger:mainfrom
aluzzardi:ci-same-source
May 6, 2022
Merged

samalba merged 1 commit into
dagger:mainfrom
aluzzardi:ci-same-source

Conversation

@aluzzardi

@aluzzardi aluzzardi commented May 4, 2022 •

Copy link
Copy Markdown
Contributor

Speeds up CI considerably.

/cc @marcosnils @crazy-max

I did see the history of this here #2288 (review) but I didn't quite understand.

We were ending up uploading the context twice with different excludes, the other upload not excluding node_modules which is pretty massive

@aluzzardi
aluzzardi requested a review from a team as a code owner May 4, 2022 23:07
@aluzzardi
aluzzardi requested review from jlongtine and sipsma May 4, 2022 23:07
@marcosnils

marcosnils commented May 5, 2022 •

Copy link
Copy Markdown
Contributor

@aluzzardi the main reason to do this is because the Dockerfile target doesn't need the website folder. If you do dagger do build docker without any cache, we're going to be sending the website folder which is quite large (~250mb) to the context unnecessarily.

So what we really need is to dynamically load the context depending on the target action. If the action is build docker, website should be omitted. Otherwise, it should be included.

@aluzzardi

Copy link
Copy Markdown
Contributor Author

@aluzzardi the main reason to do this is because the Dockerfile target doesn't need the website folder. If you do dagger do build docker without any cache, we're going to be sending the website folder which is quite large (~250mb) to the context unnecessarily.

The website folder without node_modules (which is excluded) is actually ~8MB

@marcosnils

Copy link
Copy Markdown
Contributor

The website folder without node_modules (which is excluded) is actually ~8MB

I might have missed the node_modules exclusion. I guess it's ok to merge if speeds up builds. However, having a way to exclude the website folder for the docker action would be neat. I do see this useful in a similar context with larger folder sizes

@sipsma

sipsma commented May 5, 2022

Copy link
Copy Markdown
Contributor

I thought the issue being fixed here is just that the previous code resulted in . and ./ both being loaded separately, which meant that even if ./ skipped loading the website dir we weren't saving time because . loaded it anyways. Am I misunderstanding?

@marcosnils

Copy link
Copy Markdown
Contributor

that even if ./ skipped loading the website dir we weren't saving time because . loaded it anyways

The main current issue here is that the ./ loading is not excluding node_modules (which should be fixed) so if you do a dagger do build that's going to take considerably a large amount of time because of this. What we need in reality is a way to incrementally merge the input depending on the actions that needs it. Here's a PR which I think has the best of both worlds: #2403

WDYT?

@aluzzardi

Copy link
Copy Markdown
Contributor Author

I don't think anything requires website/ at the moment, I think we could just exclude it and keep a single source.

The website folder without node_modules (which is excluded) is actually ~8MB

It's actually 3.5MB if we exclude website/build (which is not checked into git). Including or excluding website won't make any substantial performance difference at the end of the day. Did you notice any performance issue? Asking because I may have missed the underlying issue this is solving

@marcosnils

Copy link
Copy Markdown
Contributor

I don't think anything requires website/ at the moment, I think we could just exclude it and keep a single source.

If that's the case, even better. Since it was initially there I thought there was a reason. If nothing is using it, let's just exclude it altogether and just keep a single source. 👍

@marcosnils

Copy link
Copy Markdown
Contributor

@aluzzardi let's exclude website before merging 🙏

Signed-off-by: Andrea Luzzardi <[email protected]>
@aluzzardi

Copy link
Copy Markdown
Contributor Author

@aluzzardi let's exclude website before merging 🙏

Done!

@samalba
samalba merged commit c450058 into dagger:main May 6, 2022
@marcosnils

Copy link
Copy Markdown
Contributor

image

someone is back to coding 👨‍💻 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants