Operations grimoire/Dwellers to DevCentral: Difference between revisions

From Nasqueron Agora
No edit summary
(Modernize the configuration, mainly by just removing the devcentral.docker.ulubis dance)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
This document explains how to communicate with DevCentral from the Docker host.
Arcanist is available on the paas-docker role when dev extensions are enabled as container. The <code>arc</code> command is a wrapper to spin a container with symlinks to the configuration stored in your $HOME/.arc directory.
 
If you're interested to communicate between DevCentral and a Docker container, see [[Operations grimoire/Git operations in production containers|Git operations in production containers]]
 
== Rewrite remotes ==
 
<code>ssh://vcs@devcentral.nasqueron.org:5022/diffusion/DJENKINSSLAVES/docker-jenkins-slaves.git</code>
 
becomes:
 
<code>ssh://vcs@devcentral.docker.ulubis/diffusion/DJENKINSSLAVES/docker-jenkins-slaves.git</code>
 
See https://devcentral.nasqueron.org/T958 for discussion about DNS.


== Arcanist ==
== Arcanist ==
Line 20: Line 8:
# a <code>arcrc</code> file for your arc configuration
# a <code>arcrc</code> file for your arc configuration
# a <code>gitconfig</code> file for your Git configuration
# a <code>gitconfig</code> file for your Git configuration
# a <code>ssh</code> folder with a dedicated key for Dwellers to Phabricator instances (<code>mkdir -p ~/.arc/ssh && ssh-keygen -t ed25519 ~/.arc/ssh/id_ed25519</code>)
# a <code>ssh</code> folder with a dedicated key for Dwellers to Phabricator instances (<code>mkdir -p ~/.arc/ssh && ssh-keygen -t ed25519 ~/.arc/ssh/id_ed25519</code>) if you wish to use commands like <code>arc land</code>


For example:
For example:
Line 36: Line 24:
That folder content will be passed as volumes to the container. In the example, known_hosts has been added by ssh client inside the container.
That folder content will be passed as volumes to the container. In the example, known_hosts has been added by ssh client inside the container.


Don't use symbolic links (hard links are okay), they wouldn't resolve when passed as a volume to the container.
Don't use symbolic links on host (hard links are okay), they wouldn't resolve when passed as a volume to the container.
 
To check if all works as expected: <code>arc shell</code>, then, in the container, <code>ssh -p 5022 vcs@devcentral.nasqueron.org</code>
 
== Troubleshoot ==
=== Usage Exception: `arc diff` is only supported under git, hg, svn ===
 
You issue a command to manipulate a Git repository:
 
<source lang="console">
$ arc diff
Usage Exception: `arc diff` is only supported under git, hg, svn.
</source>
 
You must be at the root of the repository, not in a subfolder, as Arcanist needs access to the repository too and the wrapper script uses <code>-v $PWD:/opt/workspace</code> to pass the current folder as workspace.
 
If you only use Git and not other VCS, a solution could be to copy <code>/usr/local/bin/arc</code> to <code>$HOME/bin/arc</code> and to replace $PWD by <code>`git rev-parse --show-toplevel`</code> to pass instead of the current directory the root directory. But beware that would create inconsistent behavior like <code>arc lint quux/foo.py</code> when you're already in the quux folder.

Latest revision as of 19:06, 15 April 2024

Arcanist is available on the paas-docker role when dev extensions are enabled as container. The arc command is a wrapper to spin a container with symlinks to the configuration stored in your $HOME/.arc directory.

Arcanist

arc is a wrapper to run nasqueron/arcanist container.

To use it, create a ~/.arc folder with:

  1. a arcrc file for your arc configuration
  2. a gitconfig file for your Git configuration
  3. a ssh folder with a dedicated key for Dwellers to Phabricator instances (mkdir -p ~/.arc/ssh && ssh-keygen -t ed25519 ~/.arc/ssh/id_ed25519) if you wish to use commands like arc land

For example:

.
├── arcrc
├── gitconfig
└── ssh
    ├── id_ed25519
    ├── id_ed25519.pub
    └── known_hosts

That folder content will be passed as volumes to the container. In the example, known_hosts has been added by ssh client inside the container.

Don't use symbolic links on host (hard links are okay), they wouldn't resolve when passed as a volume to the container.

To check if all works as expected: arc shell, then, in the container, ssh -p 5022 vcs@devcentral.nasqueron.org

Troubleshoot

Usage Exception: `arc diff` is only supported under git, hg, svn

You issue a command to manipulate a Git repository:

$ arc diff
Usage Exception: `arc diff` is only supported under git, hg, svn.

You must be at the root of the repository, not in a subfolder, as Arcanist needs access to the repository too and the wrapper script uses -v $PWD:/opt/workspace to pass the current folder as workspace.

If you only use Git and not other VCS, a solution could be to copy /usr/local/bin/arc to $HOME/bin/arc and to replace $PWD by `git rev-parse --show-toplevel` to pass instead of the current directory the root directory. But beware that would create inconsistent behavior like arc lint quux/foo.py when you're already in the quux folder.