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

Organize samples #366

Closed
SaschaSchwarze0 opened this issue Aug 31, 2020 · 14 comments
Closed

Organize samples #366

SaschaSchwarze0 opened this issue Aug 31, 2020 · 14 comments
Assignees
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation.

Comments

@SaschaSchwarze0
Copy link
Member

Samples consist of two pieces:

  • A source code repository
  • A build CR, and for completeness, a buildrun CR

As of today, we have the CR samples in the samples directory. In, addition, for e2e tests, more CRs are in the test/data directory. That's fine for now.

Our sample code repositories are distributed across the planet. I suggest to bring them into the shipwright-io organization to mitigate that somebody removes the repos.

There are several ways to setup these repos. Putting together some options.

(1) A single samples repository named samples with a directory structure containing the sample code

(+) A single visible has good visibility
(-) Can become large. A lot of unnecessary files will be cloned for a build run.
(-) Does not work for build strategies that do not yet / can never support the contextDir feature. Not sure if we have some.

(2) One repository for each strategy named samples-{strategy}, may or may not contain sub-directories for different languages, e. g. sample-docker or sample-buildpacks

(+) Good for somebody who specifically looks how the sources for a specific strategy need to be prepared.
(-) Does not work for build strategies that do not yet / can never support the contextDir feature. Not sure if we have some.

(3) One repository for each language named sample-{language} (e. g. sample-java). Sample is built in a way supporting multiple strategies (specifically thinking about docker and buildpacks)

(+) Good for somebody who specifically looks for how the sources for a specific language can be built and who does not know much about the strategies
(+) Is small which will speed up e2e tests that use the repo.
(-) Can be confusing because it will contain a Dockerfile that is needed for a docker build but unnecessary for buildpacks. And will contain a buildpack.yml to configure certain buildpack details but that file is not relevant for the docker build.

@adambkaplan
Copy link
Member

If the samples are going to include source code to build, then I am inclined to go with option 3. I really like the idea of having multiple build strategies highlighted with the same set of source code. Being able to pick and choose build strategies is the "killer feature" IMO.

We should probably restrict the number of sample-xxx repositories to two or three languages - perhaps Java, NodeJS, and Python?

I also think we should use example-xxx instead of sample - a sample is generic, an example is specific.

@adambkaplan
Copy link
Member

This is an "option 3" example I cooked up today: https://github.com/adambkaplan/shipwright-example-nodejs

@zhangtbj
Copy link
Contributor

zhangtbj commented Sep 3, 2020

I think we should have both option 2 and option 3 in our new org: https://github.com/shipwright-io

For different types of example and for different tests.

@adambkaplan adambkaplan self-assigned this Sep 14, 2020
@qu1queee qu1queee added this to the release-v0.4.0 milestone Feb 17, 2021
qu1queee added a commit to qu1queee/build that referenced this issue Feb 17, 2021
The existing one have an issue on the go.mod definition, leading
to build failures when using the latest golang image.

This PR changes the repo to use, which have the fixes in place. This
is a fix PR, the end-goal is to tackle issue shipwright-io#366 which should avoid
problems like this in the future.
qu1queee added a commit to qu1queee/build that referenced this issue Feb 17, 2021
The existing one have an issue on the go.mod definition, leading
to build failures when using the latest golang image.

This PR changes the repo to use, which have the fixes in place. This
is a fix PR, the end-goal is to tackle issue shipwright-io#366 which should avoid
problems like this in the future.
@zhangtbj
Copy link
Contributor

zhangtbj commented Mar 2, 2021

Hi @adambkaplan or @qu1queee ,

I think we can go head moving the samples to our Shipwright org for v0.4.0

As we discussed in the meeting, we planed to create some separate repos for different source.

Like:

I found I have the permission to create new repo like:
https://github.com/shipwright-io/samples-npm-simple

If no objection, we will open the new repos for these personal sources and switch in our e2e test.

@qu1queee
Copy link
Contributor

qu1queee commented Mar 2, 2021

@zhangtbj thanks. I think is fine, but I will prefer different names, something like:

@zhangtbj
Copy link
Contributor

zhangtbj commented Mar 2, 2021

Agree, they are better names.

If all agree, we can create the new repos by following these names.

BTW, @qu1queee, I cannot delete this repo: https://github.com/shipwright-io/samples-npm-simple

Can you help delete it on your side?

@qu1queee qu1queee mentioned this issue Mar 2, 2021
4 tasks
@qu1queee
Copy link
Contributor

qu1queee commented Mar 2, 2021

@zhangtbj so I covered most of the work via #635. PR explains what I did, Im looking for help with:

  • we are missing the repo for JAVA runtime and the source code there. @SaschaSchwarze0 maybe you can help here.

Im looking for feedback in general for the new repos:
- https://github.com/shipwright-io/sample-php
- https://github.com/shipwright-io/sample-ruby
- https://github.com/shipwright-io/sample-nodejs
- https://github.com/shipwright-io/sample-go

@adambkaplan fyi ^^

@qu1queee qu1queee self-assigned this Mar 2, 2021
@SaschaSchwarze0
Copy link
Member Author

SaschaSchwarze0 commented Mar 3, 2021

we are missing the repo for JAVA runtime and the source code there. @SaschaSchwarze0 maybe you can help here.

I do not think I can create a repo, but if somebody creates one, I can add some Java sample to it.

Just noticed that I can create some repo. I created sample-java. Will add code to it later.

@SaschaSchwarze0
Copy link
Member Author

Done. Is here: sample-java. @qu1queee

@adambkaplan adambkaplan added kind/documentation Categorizes issue or PR as related to documentation. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 10, 2021
@adambkaplan
Copy link
Member

Remaining item - we need to configure a private repository to facilitate our end to end test suites which clone source from private git repos.

@mattcui
Copy link
Contributor

mattcui commented Mar 19, 2021

I would like to pick up this issue to add an e2e test for testing image building from a private repo.

@adambkaplan
Copy link
Member

I've split the private repository work into a separate issue: #689

@adambkaplan
Copy link
Member

/close

Given that we are tracking the private repository work into a separate issue, I think we can call this issue done.

@openshift-ci-robot
Copy link

@adambkaplan: Closing this issue.

In response to this:

/close

Given that we are tracking the private repository work into a separate issue, I think we can call this issue done.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

No branches or pull requests

6 participants