Replies: 2 comments
-
At first glance, it sounds like an anti-pattern to have a task whose behavior can be directly influenced by the outside world at runtime. In broad strokes, the approach is effectful (not pure/idempotent) and it's not intrinsically transparent. For example, If you're running some kind of server process in a task container, it gets a lot trickier to reason about a build after it finishes - if this task fails or does something unexpected, how do you figure out why? Instead of being able to inspect the version history of a resource you end up intercepting a task container (provided the build actually failed and didn't just do something weird but still exit with a success code... or maybe you're diligent about uploading the logs to a bucket somewhere after every task execution... anyway, it's a can of worms) and look into server logs, potentially cross-referencing against logs in external systems. If you're integrating with the outside world, the idiomatic way to do it is with a resource - could these external systems instead be sending a webhook? This kind of approach would require the external system to:
If this external system is not your own bespoke creation, there's a good chance that you won't get those properties for free! As you can probably imagine, in order to really answer this question you've probably got to get a bit more specific about your use case - respecting your privacy, what is running in the task? What is the external system you're trying to integrate with? Zooming out a bit further - you asked for your tasks to be able to receive input from the outside world. What problem were you trying to solve when you decided on this approach? It sounds a bit like you had a task to begin with, but you discovered that you wanted to dynamically modify its behavior beyond what |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks a lot for the amazing and detailed response, I really appreciate it! Now regarding our use case, I know its not a normal use case as traditionally you want jobs to be idempotent and store everything externally to ensure consistent results. However, in this specific case we have the following: We are building automated tests for a specific system that once started will require at some point input from a human (numeric input, tokens, captcha that are random etc...). It will start, work up to the point where it needs human input, at which point it will notify us that something is required and we need to provide this input so that it can continue the rest of the test. We have now way of knowing what these inputs are before hand, so we cant automate this process. These requirements of the project can not be changed, so we have to deal with them somehow. The input can be sent to a port, through a webhook or anything like that, but I am thinking we might be forced to use something other than Concourse in this case (a custom server?). I was wondering if such a thing can be done in concourse, its just nice to have everything in one place with logs, notifications etc, but I also understand it might be the wrong tool for the job. Would love your input on this. |
Beta Was this translation helpful? Give feedback.
-
Hello,
So we are running some tasks on Concourse and we would like them to be able to receive some post requests from other systems.
Is it possible to run a job/task and have it available on a certain port on concourse? If not, is there some recommended mechanism where we can let a task receive input from the outside world?
Thanks a lot :)
Beta Was this translation helpful? Give feedback.
All reactions