# DVC and Hydra integration

**URL:** https://discuss.dvc.org/t/dvc-and-hydra-integration/868
**Category:** Questions
**Created:** [September 2, 2021, 3:57pm UTC](https://discuss.dvc.org/t/dvc-and-hydra-integration/868 "2021-09-02T15:57:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yisaienkov](https://avatars.discourse-cdn.com/v4/letter/y/a698b9/32.png) [@yisaienkov](https://discuss.dvc.org/u/yisaienkov)
#### Post date: [September 2, 2021, 3:57pm UTC](https://discuss.dvc.org/t/dvc-and-hydra-integration/868/1 "2021-09-02T15:57:46Z")

</div>

Hello!

I want to integrate DVC pipelines and parameters/metrics tracking with Hydra loggings and configs. What best practices could I check?

Some questions:

- how to configure hydra outputs dir to normal save logs and artifacts from the different pipeline stages?
- how to connect dvc params.yaml with hydra conf?

---

<div class="post-metadata">

### Author: ![daavoo](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@daavoo](https://discuss.dvc.org/u/daavoo)
#### Post date: [September 3, 2021, 8:13am UTC](https://discuss.dvc.org/t/dvc-and-hydra-integration/868/2 "2021-09-03T08:13:58Z")

</div>

Hi @yisaienkov !

There is not an out-of-the-box integration between DVC Pipelines and Hydra, yet. We are [currently exploring](https://github.com/iterative/dvc/discussions/6506) what improvements could be made in that regard. Don’t hesitate on commenting your opinions or requests on that discussion or new issues.

As best practices that can be recommended now, it would depend on how you are using hydra within the stages, any additional info about your pipeline would be helpful. Regardless, here are some thoughts, assuming a basic Hydra app like [the one used in the tutorial](https://hydra.cc/docs/tutorials/basic/your_first_app/simple_cli):

Regarding “ **hydra outputs** ” I would [override `hydra.output_subdir`](https://hydra.cc/docs/tutorials/basic/running_your_app/working_directory/#changing-or-disabling-the-output-subdir) to None and use [DVC `outputs`](https://dvc.org/doc/user-guide/glossary)` as you would usually do without Hydra. You don’t really need to use the subfolder date-based versioning that Hydra provides as DVC+Git will do the proper versioning for you.

Regarding “ **hydra config** ”, I would suggest tracking the parent config directory as a [DVC `dependency`](https://dvc.org/doc/user-guide/glossary).

Putting all together for [this sample application](https://github.com/facebookresearch/hydra/tree/main/examples/tutorials/basic/your_first_hydra_app/4_config_groups) the `dvc.yaml` would be:

```auto
satages:
  my_app:
    cmd: python my_app.py ${hydra_args}
    deps:
      - conf
    outs:
      - my_app_output

```

And `params.yaml`:

```auto
hydra_args: "+db=postgresql db.timeout=20"

```

You would just run this with `dvc repro` and modify `params.yaml` to pass other args to hydra.

As said in the beginning, these are just some workarounds for a very simple app. If you are wiling to share more details, we can discuss your use case and see what else can be done.

---

<div class="post-metadata">

### Author: ![yisaienkov](https://avatars.discourse-cdn.com/v4/letter/y/a698b9/32.png) [@yisaienkov](https://discuss.dvc.org/u/yisaienkov)
#### Post date: [September 3, 2021, 8:41am UTC](https://discuss.dvc.org/t/dvc-and-hydra-integration/868/3 "2021-09-03T08:41:53Z")

</div>

Thank you @daavoo !  
It’s a good example and explanation!

I will go deeper into this topic and if I will have more questions I will ask 🙃

---

<div class="post-metadata">

### Author: ![TheDataCoder](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@TheDataCoder](https://discuss.dvc.org/u/TheDataCoder)
#### Post date: [July 13, 2022, 3:44pm UTC](https://discuss.dvc.org/t/dvc-and-hydra-integration/868/4 "2022-07-13T15:44:27Z")

</div>

Hello!

Are there any news on Hydra-DVC pipelines integration? I’m currently using both in my projects and would love if there would be any options to use hydra configs and dvc piplelines from console with dvc experiment run/dvc repro.

---

<div class="post-metadata">

### Author: ![daavoo](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@daavoo](https://discuss.dvc.org/u/daavoo)
#### Post date: [July 22, 2022, 8:44am UTC](https://discuss.dvc.org/t/dvc-and-hydra-integration/868/5 "2022-07-22T08:44:38Z")

</div>

Hi @TheDataCoder , sorry for the late reply. We are currently working on a more in-depth integration between DVC and Hydra. I don’t have an accurate ETA but should be ready before the end of this quarter

---

<div class="post-metadata">

### Author: ![daavoo](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@daavoo](https://discuss.dvc.org/u/daavoo)
#### Post date: [September 22, 2022, 3:25pm UTC](https://discuss.dvc.org/t/dvc-and-hydra-integration/868/6 "2022-09-22T15:25:30Z")

</div>

For the record, here are the docs of the DVC \<\> Hydra integration we have recently released:

> **[Hydra Composition](https://dvc.org/doc/user-guide/experiment-management/hydra-composition)**
>
> Open-source version control system for Data Science and Machine Learning projects. Git-like experience to organize your data, models, and experiments.
