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

Allow different concurrent development environments on a single machine #615

Closed
jifox opened this issue Jun 24, 2021 · 6 comments
Closed
Labels
type: feature Introduction of new or enhanced functionality to the application type: housekeeping Changes to the application which do not directly impact the end user

Comments

@jifox
Copy link
Contributor

jifox commented Jun 24, 2021

Environment

  • Python version: 3.8.5
  • Nautobot version: 57c8b8f1e8cc (v1.0.4b1)

Proposed Functionality

The project_name specified within "invoke" should be taken into account when building the docker image with invoke build

Use Case

As a developer I want to be able to have different development environments on the developers machine (different projects).

The problem with the current invoke build version ist, that the container image name will not be affected by the docker-compose --project-name ... parameter because it is fully specified as image name in docker-compose.yml file. Thus overwriting the image of all the other project when invoke build is executed.

services:
  nautobot:
    build:
      args:
        PYTHON_VER: "${PYTHON_VER}"
      context: ../
      dockerfile: docker/Dockerfile
      target: dev
    image: "networktocode/nautobot-dev-py${PYTHON_VER}:local"
    ports:
      - "8000:8080"
    depends_on:
      - postgres

Database Changes

None

External Dependencies

None

@glennmatthews
Copy link
Contributor

Good suggestion! I think fixing this may be a bit more involved than just adding the project_name; we also need to consider making it possible to override the exposed ports (8080 and 4444) by each running development environment.

@glennmatthews glennmatthews added type: feature Introduction of new or enhanced functionality to the application type: housekeeping Changes to the application which do not directly impact the end user labels Jun 24, 2021
@itdependsnetworks
Copy link
Contributor

Is some of this better supported with a docker-compose-override.yml that the invoke command looks for and proper documentation? This is a pattern we have used before, but not sure it exactly fits here.

@jifox
Copy link
Contributor Author

jifox commented Jun 25, 2021

I see that using the docker-compose-override.yml override method will solve my problems.

As I can see one can specifiy the override filename with the compose_override_file: "docker-compose.override.yml" in invoke.yml file

For me this solves all my needs and I'm proceeding by creating project specific override.yml files.

@jedelman8
Copy link
Contributor

@jifox looks like we're good to close as you were able to move forward with overrides?

@jifox
Copy link
Contributor Author

jifox commented Aug 5, 2021

@jedelman8 Yes, you're right.

@glennmatthews
Copy link
Contributor

I'll close this then - thanks! FYI there are some workflow changes here in 1.1.x - if you get a chance to review #782, it would be appreciated!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new or enhanced functionality to the application type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

4 participants