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

Allow building only desired chunks #763

Closed
Tracked by #659
kylos101 opened this issue Jan 24, 2022 · 9 comments · Fixed by #764 or #769
Closed
Tracked by #659

Allow building only desired chunks #763

kylos101 opened this issue Jan 24, 2022 · 9 comments · Fixed by #764 or #769
Assignees

Comments

@kylos101
Copy link
Collaborator

Is your feature request related to a problem? Please describe

Inspecting how a new test is running requires building all chunks and running all tests, which makes for a long dev loop.

Describe the behaviour you'd like

Provide a means to build and run a subset of chunks (which could also be a single chunk)

Describe alternatives you've considered

Create a new branch to do testing from main, just with the chunks I want to build and test.
Once the tests are working, copy them into yet another new branch created from main.

Additional context

This should help folks more easily test, which will hopefully encourage more authoring of tests.

@princerachit princerachit self-assigned this Mar 3, 2022
@princerachit princerachit changed the title Add a means to test a subset of chunks (which could be one chunk) Allow building only desired chunks Mar 4, 2022
@princerachit
Copy link
Contributor

Dazzle already has an ignore flag at project level that can be used to ignore chunks. This issue is requesting same feature through addition instead of negation.

e.g. command

dazzle project ignore dep-cacert-update

results in the following section being added to dazzle.yml file.

combiner:
  combinations: []
ignore:
- dep-cacert-update

While building, the chunks mentioned here are ignored.

https://github.com/gitpod-io/dazzle/blob/87d48f997df4ce37c97cc4169b4908e4ad2939a7/pkg/dazzle/project.go#L200-L202

I think it is better to reuse this flag than adding another one. what are your thoughts @kylos101 @Furisto ?

@Furisto
Copy link
Member

Furisto commented Mar 4, 2022

@princerachit I was not aware of that flag. That's great!. We could write a simple script like
for file in $(ls chunks) ; do dazzle project ignore "$file"; done
to add every chunk. Just have to remove the one that you are currently working on.

When I do that and run dazzle-up.sh the build process seems to be stuck in some kind of endless loop where it builds the same thing over and over again.

Edit: Actually this might have just been different variants.

@kylos101
Copy link
Collaborator Author

kylos101 commented Mar 4, 2022

That could work, @princerachit , nice find! As @Furisto suggested, we could update the script (as needed) to remove chunks we want to work with.

@kylos101
Copy link
Collaborator Author

kylos101 commented Mar 4, 2022

That could work, @princerachit , nice find! As @Furisto suggested, we could update the script (as needed) to remove chunks we want to work with.

Ignore works as advertised. 🙂

We could change dazzle-up.sh so that:

  1. It takes an array of chunks as input that we intend to build and combine
  2. It builds an ignore list for all chunks, excluding the ones supplied as input
  3. Build "as is" and Combine (not using --all, but instead using the input chunks). @Furisto this might explain why you saw the long combine time?
  4. Remove the ignore list on error or complete (using yq, will need to be added to the docker image)

Finally, when reviewing PRs, we'd just have to make sure we don't accidently include the ignore.

WDYT? @Furisto and @princerachit ?

@Furisto
Copy link
Member

Furisto commented Mar 4, 2022

@kylos101 Makes sense, will adapt the script

@Furisto Furisto self-assigned this Mar 4, 2022
@kylos101
Copy link
Collaborator Author

kylos101 commented Mar 4, 2022

Thanks, @Furisto ! Adding a brief mention in our contribution guide might help too. For example, if the user wants to alter tool-postgresql, etc.

@kylos101
Copy link
Collaborator Author

kylos101 commented Mar 4, 2022

@Furisto given this:

Build "as is" and Combine (not using --all, but instead using the input chunks). @Furisto this might explain why you saw the long combine time?

For the input args, we might want two things:

  1. an array of chunks (to be used for dazzle build)
  2. a combination name (to be used for dazzle combine)

Why? Combination definitions in the dazzle.yaml sometimes include reference combination(s), as well as chunks. Assuming we just want to combine the chunks is invalid, best to use the definition in the dazzle.yaml file.

I didn't realize bash has a getopts function! Take a look at what @aledbf did here. Might make sense to use for dazzle-up.sh, too.

@kylos101
Copy link
Collaborator Author

kylos101 commented Mar 7, 2022

@Furisto I am going to transfer this to our workspace-images repo

@kylos101 kylos101 transferred this issue from gitpod-io/dazzle Mar 7, 2022
@kylos101 kylos101 moved this from In Progress to Scheduled in 🌌 Workspace Team Mar 7, 2022
@kylos101
Copy link
Collaborator Author

kylos101 commented Mar 7, 2022

@princerachit , if you could take on this issue, that would help us get very close to completing this related epic. Let us know?

@Furisto I'm not sure if you have any script prepared for this already? If you do, can you share?

@princerachit princerachit self-assigned this Mar 8, 2022
@kylos101 kylos101 moved this from Scheduled to In Progress in 🌌 Workspace Team Mar 8, 2022
Repository owner moved this from In Progress to Done in 🌌 Workspace Team Mar 13, 2022
This was referenced Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
3 participants