Skip to content

run publishM2 only once#141

Merged
octonato merged 3 commits intomainfrom
rgc/fix-maven-cache-issue
Jul 14, 2021
Merged

run publishM2 only once#141
octonato merged 3 commits intomainfrom
rgc/fix-maven-cache-issue

Conversation

@octonato
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

@raboof raboof left a comment

Choose a reason for hiding this comment

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

I'm happy if CI is 😆

@octonato
Copy link
Copy Markdown
Member Author

CleanShot 2021-07-13 at 15 48 11

CI beautifully shows the job dependency graph, but build fails because artifact not found.

Anyway, I think this is the structure we want. We now need to find out why the cache is not working as expected.

@marcospereira
Copy link
Copy Markdown

build fails because artifact not found.

That is because jobs don't share artifacts. You can try to use the same cache across different jobs, but I not sure if this is a proper solution.

@octonato
Copy link
Copy Markdown
Member Author

That is because jobs don't share artifacts. You can try to use the same cache across different jobs, but I not sure if this is a proper solution.

That's the part of the puzzle we are not understanding. We are caching the artifacts. We have been doing so in an attempt to reduce build time, but now it seems that we never re-use the cache between jobs which makes it useless.

@octonato
Copy link
Copy Markdown
Member Author

I believe the issue is related with concurrent cache writes. Jobs restore a cache and save it back a the end. I can then override a cache containing the artifact that we just published. The next job will then fail with artifact not found error.

@octonato
Copy link
Copy Markdown
Member Author

@marcospereira, I'm not sure how to understand the CircleCI docs, but maybe you know more about it. Is that so that a cache is re-used between the same job (over different workflow runs), but not shared by two jobs in the same workflow?

I'm trying now a different approach. I'm calling publishM2 on each job that needs it, but then only once.

Previously, a single job was calling publishM2 more than once and that's was clearly wrong.

Anyway, CI is building now.

@octonato octonato requested a review from raboof July 13, 2021 19:26
@pvlugter
Copy link
Copy Markdown
Member

pvlugter commented Jul 14, 2021

CircleCI has a feature called workspaces, where you can have a filesystem shared between jobs in the same workflow.

https://circleci.com/docs/2.0/persist-data/

https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs

We've used it before to only build docker images once and pass these across jobs.

@octonato octonato force-pushed the rgc/fix-maven-cache-issue branch from 7df1c15 to 6d7bab9 Compare July 14, 2021 06:22
Copy link
Copy Markdown
Member Author

@octonato octonato left a comment

Choose a reason for hiding this comment

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

This is ready for another review.

I added the build dependencies changes we discussed during stand-up.

Comment thread .circleci/config.yml
Comment on lines -312 to -314
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As discussed during stand-up, we won't run the tests when tagging. That's the default behavior in CircleCI, hence the removal of this config settings.

Comment thread .circleci/config.yml
Comment on lines +307 to +308
- checks
- validate-docs
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

only starting the tests if the basic validation passes

Comment thread .circleci/config.yml
- samples-tests
- tck-tests
- validate-docs
- publish
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

only publish maven if main artifacts got published

Comment thread .circleci/config.yml
- integration-tests
- tck-tests
- validate-docs
- publish
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm wondering why the tck is an apart publishing step. Shouldn't that be just part of the main artifacts?

Anyway, we can change on follow-up PR.

Copy link
Copy Markdown
Member Author

@octonato octonato Jul 14, 2021

Choose a reason for hiding this comment

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

Nevermind. I forgot that the TCK involves the publishing of a docker image. So, makes sense to have it's own step.

Copy link
Copy Markdown
Contributor

@johanandren johanandren left a comment

Choose a reason for hiding this comment

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

LGTM but I don't know circle-ci enough to know if there is still some issue with shared cache whatnot that you discussed during standup.

@octonato
Copy link
Copy Markdown
Member Author

LGTM but I don't know circle-ci enough to know if there is still some issue with shared cache whatnot that you discussed during standup.

that's the surprise effect, we will only see if after we merge and try to release :-)

@octonato octonato merged commit 010bc45 into main Jul 14, 2021
@octonato octonato deleted the rgc/fix-maven-cache-issue branch July 14, 2021 15:04
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.

5 participants