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

Make lockfiles optional for dev containers. #620

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

rochacbruno
Copy link
Member

@rochacbruno rochacbruno commented Jan 22, 2021

Changes

Add LOCK_REQUIREMENTS variable on .compose.env
when this variable is set to 0 compose build will
bypass the installation of requirements/* lock files
avoiding VersionConflicts when using master checkout
for pulpcore and pulp_ansible.

also if that variable is set to 0 the entrypoint invoked
by ./compose up|run will bypass the optization argument
--no-deps allowing the installation of bleeding edge
requirements introduced by pulp_ansible/pulpcore.

NO breaking change is added, the new variable is by default set to 1 to keep the current behaviour.

Steps to run dev environment with specific upstream branch

  1. Clone locally galaxy_ng, pulpcore and pulp_ansible all the
    repos must be located at the same directory level.

    cd ~/projects/
    git clone https://github.com/pulp/pulpcore
    git clone https://github.com/pulp/pulp_ansible
    git clone https://github.com/ansible/galaxy_ng
    # and optionally
    git clone https://github.com/ansible/ansible-hub-ui
    git clone https://github.com/ansible/galaxy_importer
    
  2. Checkout to desired branches.
    pulp_ansible master is compatible with a specific range of pulpcore
    versions. So the recommended is to checkout to specific branch or
    tag following the contraints defined on pulp_ansible/requirements.txt
    or leave it checked out to master if you know it is compatible with
    the pulp_ansible branch you have.
    Example:

    cd ~/projects/pulpcore
    git checkout 3.9.0
    

    This is also possible to checkout to specific pull-requests by its
    refs/pull/id.

  3. Edit the galaxy_ng/.compose.env file.

    cd ~/projects/galaxy_ng
    cat .compose.env
    
    COMPOSE_PROFILE=standalone
    DEV_SOURCE_PATH='pulpcore:pulp_ansible:galaxy_ng'
    LOCK_REQUIREMENTS=0
    

    DEV_SOURCE_PATH refers to the repositories you cloned
    locally, the order is important from the highest to the low
    dependecy, otherwise pip will raise version conflicts.

    So pulpcore is a dependency to pulp_ansible which is a dependency to galaxy_ng, this order must be respected on DEV_SOURCE_PATH variable.

    LOCK_REQUIREMENTS when set to 0 it tells docker to
    bypass the install of pinned requirements and rely
    only on packages defined on setup.py for each repo.

  4. Run ./compose build to make those changes efective.

  5. Run desired compose command: ./compose up, ./compose run etc...

Further details on How to run galaxy_ng dev environment
with specific git branched are written on the galaxy_ng/wiki.

Issue: AAH-257

Copy link
Contributor

@cutwater cutwater left a comment

Choose a reason for hiding this comment

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

LGTM

Add `LOCK_REQUIREMENTS` variable on `.compose.env`
when this variable is set to `0` compose build will
bypass the installation of `requirements/*` lock files
avoiding VersionConflicts when using `master` checkout
for `pulpcore` and `pulp_ansible`.

also if that variable is set to `0` the entrypoint invoked
by `./compose up|run` will bypass the optization argument
`--no-deps` allowing the installation of bleeding edge
requirements introduced by pulp_ansible/pulpcore.

1. Clone locally `galaxy_ng`, `pulpcore` and `pulp_ansible` all the
   repos must be located at the same directory level.
   ```
   cd ~/projects/
   git clone https://github.com/pulp/pulpcore
   git clone https://github.com/pulp/pulp_ansible
   git clone https://github.com/ansible/galaxy_ng
   git clone https://github.com/ansible/ansible-hub-ui
   git clone https://github.com/ansible/galaxy_importer
   ```
2. `pulp_ansible` master is compatible with a specific range of `pulpcore`
   versions. So the recommended is to checkout to specific branch or
   tag following the contraints defined on pulp_ansible/requirements.txt
   or leave it checked out to master if you know it is compatible with
   the pulp_ansible branch you have.
   Example:
   ```
   cd ~/projects/pulpcore
   git checkout 3.9.0
   ```
   This is also possible to checkout to specific pull-requests by its
   `refs/pull/id`.
3. Edit the `galaxy_ng/.compose.env` file.
   ```
   cd ~/projects/galaxy_ng
   cat .compose.env

   COMPOSE_PROFILE=standalone
   DEV_SOURCE_PATH='pulpcore:pulp_ansible:galaxy_ng'
   LOCK_REQUIREMENTS=0
   ```
   **DEV_SOURCE_PATH** refers to the repositories you cloned
   locally, the order is important from the highest to the low
   dependecy, otherwise pip will raise version conflicts.

   **LOCK_REQUIREMENTS** when set to 0 it tells docker to
   bypass the install of pinned requirements and rely
   only on packages defined on `setup.py` for each repo.
4. Run `./compose build` to make those changes efective.
5. Run desired compose command: `./compose up`, `./compose run` etc...

Further details on How to run galaxy_ng dev environment
with specific git branched are written on the galaxy_ng/wiki.

Issue: AAH-257
@newswangerd
Copy link
Member

image

Copy link
Member

@newswangerd newswangerd left a comment

Choose a reason for hiding this comment

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

LGTM. Can you add the notes in the PR here to our wiki?

https://github.com/ansible/galaxy_ng/wiki/Development-Setup

@rochacbruno rochacbruno merged commit e24ffb8 into ansible:master Feb 2, 2021
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.

3 participants