-
Notifications
You must be signed in to change notification settings - Fork 68
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
Build Stages Part 2: Stages Order and Conditions #28
Comments
Heads up, the comment on #11 points to itself instead of to here. |
Is there any chance you could implement a more fine-grained job dependency graph feature than just "wait until the previous stage is done"? E.g. in my case I have a bunch of different compiler/OS configurations, and "populate cache" and "build" stages that each have a bunch of jobs corresponding to every configuration. In principle, a "build" job could start as soon as the corresponding "populate cache" job for that configuration was done, but right now the "build" stage doesn't begin until all of the jobs in the "populate cache" stage have finished. See haskell/cabal#4556 for more details. |
Is it possible to skip cache update for a particular stage? I have a acceptance test job which should leverage cache from the previous stage. However, I don't care about the new artifacts it creates/installed (which would be cached in default configuration) and I don't want to have cache updated at the end of that particular stage (while cache still should be fetched at the beginning of that job to have build faster). |
Looks like there's a small bug. If I have multiple stages (e.g. 4) and I add conditions to run only 1 stage then the main job will stuck in "created" state. |
Hm, that's also true for multiple jobs (e.g. if conditions remove 2 jobs and 2 remain). |
@ujovlado I think that is travis-ci/travis-ci#8415. We will look into it shortly. |
@BanzaiMan thanks! |
@ujovlado No worries. That is one long standing source of confusion, which is tracked in travis-ci/travis-ci#1066. |
Does this mean we'd have CLI tool for config validation? Maybe embed it into existing travis CLI utility? |
Somewhat related to:
Feature: Set the build status when all remaining jobs and stages are allowed to fail. travis-ci/travis-ci#8425 also asks this in the case where the last stage consists of jobs which are allowed to fail. |
Guys, plz take a look at this build: https://travis-ci.org/aio-libs/multidict/jobs/275530708#L848 There must be deploy step in this job, but it's missing according to logs. I'm going to guess that some of your changes might've affected build steps resolution. Any ideas? Should I file a separate issue? |
One thing that's frustrating when working on a build with stages, compared to |
@abbeycode Each job is independently queued (in other words, only when the execution gets to that job, is it inserted into the queue). This is due to how the queue is processed; if it is in the queue, it is assumed to be runnable. If we put the last job on the queue, it may be ready to run before it is supposed to. |
@webknjaz We are not just "guys", so please refrain from using that. Thanks. :-) As for your deployment not triggering, it is reported as travis-ci/travis-ci#8337. The current workaround is to not |
Hey guys, it is being really nice to test the stage features. I would like to suggest running the stages concurrently, it would be fantastic! |
@cristopher-rodrigues We are not just "guys", so please refrain from using that. Thanks. :-)
Could you elaborate on this? If the jobs in these stages can be run concurrently, they can be in the same stage and not lose any meaning, can't they? Or did I miss some broader context? |
@hmottestad This request is listed in @svenfuchs's list above. |
@BanzaiMan Sorry for that, my bad. Look for some use case:
Something like that: ...
jobs:
include:
- stage: Tests Unit
async: true
script: ...
- stage: Tests E2E Journey Foo
async: true
script: ...
- stage: Tests E2E Journey Bar
script: ...
async: true
|
@cristopher-rodrigues If you give those three the same stage, they'll execute in parallel, won't they? Do they need to be in their own stages? |
Following on from my little experiment with sentinel jobs (travis-ci/travis-ci#2062 (comment)), I am wanting to have stages:
- name: test
fast_finish: true
if: branch != master OR type = pull_request
- name: test
fast_finish: false
if: branch = master AND type = push I've tried with |
I'm not sure if this has been covered, but I keep getting emails saying by build has errored, regardless of wether there is an error, the build passes, or the build fails. Sometimes I get these emails up to half an hour after a build has finished. |
I am having troubles getting The pylint job is allowed to fail. Any hints ? |
Hey there ! Amazing feature ! Why is the lint stage running only on Here's my travis file: Oh and one of my jobs failed weirdly: The build: |
Awesome work! |
Hey there! My suggestion is along the lines of before_script:
- echo "global"
jobs:
include:
- stage: before
before_script:
- merge: "before"
- script:
- echo "before";
- stage: after
before_script:
- merge: "after"
- script:
- echo "after";
- stage: override
before_script:
- merge: "none" # default
- script:
- echo "override"; This would execute as: stage: before
stage: after
stage: override
This could also be handled by separated optional stages |
For all of you who have asked for named jobs (“job labels”, “job descriptions”) ... this has been added and released yesterday: https://blog.travis-ci.com/2018-07-18-build-stages-officially-released Many of the questions asked here were actually support cases (some of which have been perfectly answered by some of you, such an amazing community! ❤️). Since Build Stages are officially out of beta I am going to close this GitHub issue, and recommend using our new forum for further conversations about this feature: https://travis-ci.community Thanks everyone! |
@svenfuchs thank you for all your hard work!
Since I had to click-through several links to confirm how it works, here's just an extract for others: add |
@svenfuchs I've added a proposal on improvements for job labels. I hope it has enough reasoning :) https://travis-ci.community/t/job-labels-name-improvement-proposal/79?u=webknjaz |
I love build stages! |
Being able to specify jobs from previous stages as dependencies for a job in a later stage would be nice, so if one job fails in an early stage only the jobs in later stages that are dependent on it's success are cancelled. |
Previous stage have two jobs, if one job failed, so the next stage will not be run. Actually, two jobs in stage1 are absolute, stage2-1 just only depend on stage1-1, but no dependencies with stage1-2. |
@Seluj78 Same thing for me with the random wild stages:
- name: test
if: branch = gibberish so that it is never run. Ugly workaround af, but works. |
I create jobs programatically through the Travis API (using Github Enterprise). Usually there are two stages with some jobs in each, but some times there's a single stage with a single job. In the latter cases, the Travis UI does not display the stage and job name in a list, it just proceeds as if it was a regular "simple" job. It would have been really nice to see that stage in the UI. This is similiar to matrix builds. If the matrix only has a single job, the Travis UI does not show the matrix list. I would rather that it displayed that single entry! |
I tried to use the build stages to essentially better document the CI/CD process and have multiple things building and installing at the same time. |
If you have are not just building Docker images, but need to pass file artifacts, then the official answer is something like "Use amazon s3". If you don't store a lot of stuff and remove your files often, then S3 costs you nothing. It's not a very convenient solution though. You can also abuse github releases to store your intermediate artifacts. Create a dummy tag and use the deploy step to upload your artifacts always to that tag and include the TRAVIS_BUILD_NUMBER into the file name. In a subsequent stage, download it with curl since the URL of the artifact is predictable. |
the way I do is this: deploy phase (I use semantic release): pull the docker image, run semantic-release and see if we need to release, if we do, then tag the image with appropriate version (see semantic-release for version info) |
As a relatively new Travis user I like build stages. I'm working on a project with a test and deploy stage and the test stage only had a single job to run unit tests. I wanted to add a linter job to the test stage and it was easy. My only complaint is that to organize the two jobs within the test build stage I gave them separate names but the names don't show up in the build page in the UI at all. I can see them in the "View config" tab though. If they aren't shown in the UI rather than an auto-incrementing job number, e.g. #3008.2, I'm not sure what use naming the jobs serves except organizing within the config file, which could be achieved with comments just as easily. Maybe I'm missing something about where the job names show up? |
Hi @mriedem language and environment does show up in the list: |
@Saviq, I think that @mriedem means https://docs.travis-ci.com/user/build-stages/#naming-your-jobs-within-build-stages. Honestly, I am not sure about the expected usage of that field. |
Correct, I'm wondering why if a job has a name it's not used in the UI. For example, in the screenshot in the comment above if all of those jobs had names why wouldn't the job ID, e.g. 2696.1, be replaced with the job name in the UI. The ID is useful for computers, the name is useful for humans. |
Hi, not sure if it is known or not but it looks like the build times displayed in the UI are not always correct? |
There seems to be a problem with the way that jobs clone the |
Build stages take about 1 minute to get executed, even when the |
Enjoying so far the build stages, keeps everything nice and tidy. But maybe there could be a way of adding a "pre-stage" tag to allow some sort of previous configuration. Or find some sort of way of storing and sharing docker images locally. That would be nice |
FYI: some Travis CI Enterprise installations still point to this issue for feedback for this "beta feature" although it's been long out of beta. |
We have shipped iteration 2 for the Build Stages feature.
Along with a lot of bug fixes and small improvements this includes:
Find out more about this on our blog, and documentation here and here.
We would love to hear your feedback. Please leave all thoughts, comments, ideas related to this feature here.
Happy Testing!
FAQ
What feature requests have you received for improving Build Stages so far?
We are adding this list of feature requests (with a rough indication of how likely we are going to prioritize it) so you don't have to ask about these again :)
script
etc. on the newstages
section, so they can be shared across all jobs in one stage. (Yes, but not before[1]
)allow_failure: true
per job onjobs.include
. (Probably yes, but not before[1]
.)stage
key on thedeploy
section. Turn this into a stage and a job. (Not quite sure, not before[1]
.)skip: all
, so one does not have to overwritebefore_install
,install
, andscript
. (Sounds like a good idea? Not before[1]
)jobs.include.env: [FOO=foo, BAR=bar]
. (Not quite sure).travis.yml
editor/web tool. (Yes, based on the specification produced in[1]
)[2]
)running
tab, consider grouping jobs per build (and possibly stage). (Interesting thought. We are working on improving this UI, and might consider this in a later iteration.)Other improvements:
[1]
A strict travis-yml parser has been shipped.[2]
The GitHub commit status API has the known limitation that new updates are being rejected after the 1000th update. They are working on improving this, and providing a way for us to post more updates. Until this is unblocked we are unlikely to make any changes to our commit status updates.The text was updated successfully, but these errors were encountered: