wodoo


Namewodoo JSON
Version 0.5.141 PyPI version JSON
download
home_pagehttps://github.com/marcwimmer/wodoo
SummaryOdoo Framework
upload_time2025-01-02 10:50:00
maintainerNone
docs_urlNone
authorMarc-Christian Wimmer
requires_python>=3.6.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Odoo Docker Framework

Provides functionalities:

- setup empty new odoo with one bash command `odoo init --version 15.0`

- setup full fleged odoo server environment containing
  - supports MANIFEST file in odoo root directory to install and uninstall modules
  - postgres with pg_activity, enhanced pgcli
  - fake webmail to receive AND SEND mails
  - logs.io integration to display container output on web browser
  - dividing web, cron, queuejob container per default
  - progress bar on postgres dump/restore

- fzf compatible creation of and AST of your project

- fast restore / create snapshots of complete databases using btrfs, which helps testing things on customer databases

## How to install

### Install minimum

```bash
pipx install wodoo
```


### optional: To be not blocked when working on btrfs/zfs volumes and so, this is suggested on dev machines:


```bash
cat << 'EOF' > /etc/sudoers.d/odoo
Cmnd_Alias ODOO_COMMANDS_ODOO = /usr/bin/find *, /var/lib/wodoo_env/bin/odoo *, /usr/bin/btrfs subvolume *, /usr/bin/mkdir *, /usr/bin/mv *, /usr/bin/rsync *, /usr/bin/rm *,  /usr/bin/du *, /usr/local/bin/odoo *, /usr/bin/btrfs subvol show *, /usr/sbin/gosu *
odoo ALL=NOPASSWD:SETENV: ODOO_COMMANDS_ODOO

EOF
```

## How To: Make new empty odoo instance

```bash
odoo init <folder>
cd <folder>
odoo reload
odoo -f db reset
odoo up -d

# now open browser on http://localhost
```

## Store settings in ./odoo of source code


## How to extend an existing service

- make a docker-compose file like ~/.odoo/docker-compose.yml

```yml
services:
  odoo3:
    labels:
      compose.merge: base-machine
    environment:
      WHAT YOU WANT
    volumes:
      WHAT YOU WANT

```

### Example for fixed ip addresses

```yml
services:
    proxy:
        networks:
            network1:
                ipv4_address: 10.5.0.6
networks:
    network1:
        driver: bridge
        ipam:
            config:
                - subnet: 10.5.0.0/16
```

### Some labels

```yml
services:
    new_machine:
        ...
        labels:
          odoo_framework.apply_env: 0  # do not apply global environment from settings here

```

## Using the registry

### Pushing

* Configure HUB_URL on the pusher side.
* `>odoo login`
* `>odoo build`
* `>odoo regpush`
* All images even base images like redis are pushed; tag name contains SHA name

### Pulling

* Configure `REGISTRY=1` in settings and setup `HUB_URL`
* `>odoo login`
* `>odoo regpull`
* All images will be pulled from registry

## Services Explained

### Proxy

* nodejs application
* between user browser and odoo
* if odoo is being restarted catches the requests, holds them and releases them to odoo if it is up again
* manages handling of /longpolling path; so if used in custom proxy setups, just refer to that one port here


## Tools

## Backup and Restore

```
odoo backup odoo-db <path> (or default name used)
odoo restore odoo-db <path> (or select from list)
```

### Show Database activity

```
odoo pgactivity
```


## Configurations in ~/.odoo/settings explained

| Setting      | Description|
| :---        |    :----   |
| PROJECT_NAME| Pasted into container names, postgres volumes and so on; please keep it as short as possible, as there are limits example docker containername 53 characters at time of writing|
| DBNAME | Uses projectname or a configured one|
| HUB_URL=value| user:password@host:port/paths.. to configure|
| REGISTRY=1      | Rewrites all build and images urls to HUB_URL. Should be used on production systems to force pull only from registry and block any local buildings.|
| POSTGRES_VERSION=13| Choose from 11, 12, 13, 14|
| ODOO_ENABLE_DB_MANAGER| Enables the odoo db manager|
| DEVMODE=1 | At restore runs safety scripts to disable cronjobs and mailserver and resets passwords|
| RUN_PROXY=1| If the built-in nodejs proxy is enabled |
| RUN_PROXY_PUBLISHED=0/1| If the proxy is reachable from outside the docker network example from 127.0.0.1:8069|
| PROXY_PORT| The port on which you can access with plain http the odoo|
| ODOO_IMAGES_BRANCH| The branch used for ~/.odoo/images|
| ODOO_INSTALL_LIBPOSTAL=1| If set, then the libpostal lib is installed|
| ODOO_QUEUEJOBS_CRON_IN_ONE_CONTAINER=1 | Runs queuejobs and cronjob in the odoo container where also the web application resides|
| ODOO_QUEUEJOBS_CHANNELS=root:40,magento2:1 | Configures queues for queuejob module |
|NAMED_ODOO_POSTGRES_VOLUME| Use a specific external volume; not dropped with down -v command|
|CRONJOB_DADDY_CLEANUP=0 */1 * * * ${JOB_DADDY_CLEANUP}|Turn on grandfather-principle based backup|
|RESTART_CONTAINERS=1|Sets "restart unless-stopped" policy|
|ODOO_DEBUG_LOGLEVEL=info,error,debug|Loglevel for debug inside odoo container|

## Odoo Server Configuration in ~/.odoo/settings/odoo.config and odoo.config.${PROJECT_NAME}

Contents will be appended to [options] section of standard odoo configuration.

Configuration may simple look like:


```
setting1=value1
```

or like that:

```
[options]
setting1=value1

[queue_job]
settingqj=valueqj
```

The [options] is prepended automatically if missed.

# MANIFEST File

To placed in project root.

The used odoo instance must be placed in /odoo.

```yaml
{
    "server-wide-modules": [
        "web",
        "field_onchange"
    ],
    "version": 17.0,
    "install": [ ...  ],
    "uninstall": [
        "web_tree_many2one_clickable",
        "helpdesk_create_in_new_tab"
    ],
    "devmode_uninstall": [
        "password_security",
    ],
    "tests": [
        "helpdesk_security",
        "visitreports"
    ],
    "addons_paths": [
        "odoo/odoo/addons",
        "odoo/addons",
        "enterprise",
        "addons_tools"
    ]
}



```

# RobotFramework Commands

## Install modules

Put #odoo-require: crm,sale_stock  in a line in your test

## Uninstall modules

Put #odoo-uninstall: partner_autocomplete  in a line in your test

The partner autocomplete nerves for example.

# Append to odoo docker file

* make files like "Dockerfile.appendix" anywhere in your repo
* to add files, put a directory "Dockerfile.appendix.dir" in the same level; you can
  access files of it with COPY Dockerfile.appendix.dir/*

# Before Reload Actions

If you develop a strange external repository you can define a pre action scripts,
that is executed before the reload and you can adapt some things.

# Pytests

Best executed with:

```bash
time sudo -E pytest
```

# Performance Check

```python
pipx runpip wodoo install line_profiler
~/.local/pipx/venvs/wodoo/bin/python3 -mkernprof -l -v odoo reload
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/marcwimmer/wodoo",
    "name": "wodoo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "Marc-Christian Wimmer",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/59/c1/d68d270e09dbfec3048f8a6028dd30f0111ab2b894f9c7ae0f5abeff01e4/wodoo-0.5.141.tar.gz",
    "platform": null,
    "description": "\n# Odoo Docker Framework\n\nProvides functionalities:\n\n- setup empty new odoo with one bash command `odoo init --version 15.0`\n\n- setup full fleged odoo server environment containing\n  - supports MANIFEST file in odoo root directory to install and uninstall modules\n  - postgres with pg_activity, enhanced pgcli\n  - fake webmail to receive AND SEND mails\n  - logs.io integration to display container output on web browser\n  - dividing web, cron, queuejob container per default\n  - progress bar on postgres dump/restore\n\n- fzf compatible creation of and AST of your project\n\n- fast restore / create snapshots of complete databases using btrfs, which helps testing things on customer databases\n\n## How to install\n\n### Install minimum\n\n```bash\npipx install wodoo\n```\n\n\n### optional: To be not blocked when working on btrfs/zfs volumes and so, this is suggested on dev machines:\n\n\n```bash\ncat << 'EOF' > /etc/sudoers.d/odoo\nCmnd_Alias ODOO_COMMANDS_ODOO = /usr/bin/find *, /var/lib/wodoo_env/bin/odoo *, /usr/bin/btrfs subvolume *, /usr/bin/mkdir *, /usr/bin/mv *, /usr/bin/rsync *, /usr/bin/rm *,  /usr/bin/du *, /usr/local/bin/odoo *, /usr/bin/btrfs subvol show *, /usr/sbin/gosu *\nodoo ALL=NOPASSWD:SETENV: ODOO_COMMANDS_ODOO\n\nEOF\n```\n\n## How To: Make new empty odoo instance\n\n```bash\nodoo init <folder>\ncd <folder>\nodoo reload\nodoo -f db reset\nodoo up -d\n\n# now open browser on http://localhost\n```\n\n## Store settings in ./odoo of source code\n\n\n## How to extend an existing service\n\n- make a docker-compose file like ~/.odoo/docker-compose.yml\n\n```yml\nservices:\n  odoo3:\n    labels:\n      compose.merge: base-machine\n    environment:\n      WHAT YOU WANT\n    volumes:\n      WHAT YOU WANT\n\n```\n\n### Example for fixed ip addresses\n\n```yml\nservices:\n    proxy:\n        networks:\n            network1:\n                ipv4_address: 10.5.0.6\nnetworks:\n    network1:\n        driver: bridge\n        ipam:\n            config:\n                - subnet: 10.5.0.0/16\n```\n\n### Some labels\n\n```yml\nservices:\n    new_machine:\n        ...\n        labels:\n          odoo_framework.apply_env: 0  # do not apply global environment from settings here\n\n```\n\n## Using the registry\n\n### Pushing\n\n* Configure HUB_URL on the pusher side.\n* `>odoo login`\n* `>odoo build`\n* `>odoo regpush`\n* All images even base images like redis are pushed; tag name contains SHA name\n\n### Pulling\n\n* Configure `REGISTRY=1` in settings and setup `HUB_URL`\n* `>odoo login`\n* `>odoo regpull`\n* All images will be pulled from registry\n\n## Services Explained\n\n### Proxy\n\n* nodejs application\n* between user browser and odoo\n* if odoo is being restarted catches the requests, holds them and releases them to odoo if it is up again\n* manages handling of /longpolling path; so if used in custom proxy setups, just refer to that one port here\n\n\n## Tools\n\n## Backup and Restore\n\n```\nodoo backup odoo-db <path> (or default name used)\nodoo restore odoo-db <path> (or select from list)\n```\n\n### Show Database activity\n\n```\nodoo pgactivity\n```\n\n\n## Configurations in ~/.odoo/settings explained\n\n| Setting      | Description|\n| :---        |    :----   |\n| PROJECT_NAME| Pasted into container names, postgres volumes and so on; please keep it as short as possible, as there are limits example docker containername 53 characters at time of writing|\n| DBNAME | Uses projectname or a configured one|\n| HUB_URL=value| user:password@host:port/paths.. to configure|\n| REGISTRY=1      | Rewrites all build and images urls to HUB_URL. Should be used on production systems to force pull only from registry and block any local buildings.|\n| POSTGRES_VERSION=13| Choose from 11, 12, 13, 14|\n| ODOO_ENABLE_DB_MANAGER| Enables the odoo db manager|\n| DEVMODE=1 | At restore runs safety scripts to disable cronjobs and mailserver and resets passwords|\n| RUN_PROXY=1| If the built-in nodejs proxy is enabled |\n| RUN_PROXY_PUBLISHED=0/1| If the proxy is reachable from outside the docker network example from 127.0.0.1:8069|\n| PROXY_PORT| The port on which you can access with plain http the odoo|\n| ODOO_IMAGES_BRANCH| The branch used for ~/.odoo/images|\n| ODOO_INSTALL_LIBPOSTAL=1| If set, then the libpostal lib is installed|\n| ODOO_QUEUEJOBS_CRON_IN_ONE_CONTAINER=1 | Runs queuejobs and cronjob in the odoo container where also the web application resides|\n| ODOO_QUEUEJOBS_CHANNELS=root:40,magento2:1 | Configures queues for queuejob module |\n|NAMED_ODOO_POSTGRES_VOLUME| Use a specific external volume; not dropped with down -v command|\n|CRONJOB_DADDY_CLEANUP=0 */1 * * * ${JOB_DADDY_CLEANUP}|Turn on grandfather-principle based backup|\n|RESTART_CONTAINERS=1|Sets \"restart unless-stopped\" policy|\n|ODOO_DEBUG_LOGLEVEL=info,error,debug|Loglevel for debug inside odoo container|\n\n## Odoo Server Configuration in ~/.odoo/settings/odoo.config and odoo.config.${PROJECT_NAME}\n\nContents will be appended to [options] section of standard odoo configuration.\n\nConfiguration may simple look like:\n\n\n```\nsetting1=value1\n```\n\nor like that:\n\n```\n[options]\nsetting1=value1\n\n[queue_job]\nsettingqj=valueqj\n```\n\nThe [options] is prepended automatically if missed.\n\n# MANIFEST File\n\nTo placed in project root.\n\nThe used odoo instance must be placed in /odoo.\n\n```yaml\n{\n    \"server-wide-modules\": [\n        \"web\",\n        \"field_onchange\"\n    ],\n    \"version\": 17.0,\n    \"install\": [ ...  ],\n    \"uninstall\": [\n        \"web_tree_many2one_clickable\",\n        \"helpdesk_create_in_new_tab\"\n    ],\n    \"devmode_uninstall\": [\n        \"password_security\",\n    ],\n    \"tests\": [\n        \"helpdesk_security\",\n        \"visitreports\"\n    ],\n    \"addons_paths\": [\n        \"odoo/odoo/addons\",\n        \"odoo/addons\",\n        \"enterprise\",\n        \"addons_tools\"\n    ]\n}\n\n\n\n```\n\n# RobotFramework Commands\n\n## Install modules\n\nPut #odoo-require: crm,sale_stock  in a line in your test\n\n## Uninstall modules\n\nPut #odoo-uninstall: partner_autocomplete  in a line in your test\n\nThe partner autocomplete nerves for example.\n\n# Append to odoo docker file\n\n* make files like \"Dockerfile.appendix\" anywhere in your repo\n* to add files, put a directory \"Dockerfile.appendix.dir\" in the same level; you can\n  access files of it with COPY Dockerfile.appendix.dir/*\n\n# Before Reload Actions\n\nIf you develop a strange external repository you can define a pre action scripts,\nthat is executed before the reload and you can adapt some things.\n\n# Pytests\n\nBest executed with:\n\n```bash\ntime sudo -E pytest\n```\n\n# Performance Check\n\n```python\npipx runpip wodoo install line_profiler\n~/.local/pipx/venvs/wodoo/bin/python3 -mkernprof -l -v odoo reload\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Odoo Framework",
    "version": "0.5.141",
    "project_urls": {
        "Homepage": "https://github.com/marcwimmer/wodoo"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59c1d68d270e09dbfec3048f8a6028dd30f0111ab2b894f9c7ae0f5abeff01e4",
                "md5": "5e935667919ae8a6cbed265309f8c9b3",
                "sha256": "0cecc65b850d7e2ae4339295d13d14aa4a7f51b7bc30a9e33d7685b0e4f15943"
            },
            "downloads": -1,
            "filename": "wodoo-0.5.141.tar.gz",
            "has_sig": false,
            "md5_digest": "5e935667919ae8a6cbed265309f8c9b3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.0",
            "size": 126999,
            "upload_time": "2025-01-02T10:50:00",
            "upload_time_iso_8601": "2025-01-02T10:50:00.566228Z",
            "url": "https://files.pythonhosted.org/packages/59/c1/d68d270e09dbfec3048f8a6028dd30f0111ab2b894f9c7ae0f5abeff01e4/wodoo-0.5.141.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-02 10:50:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "marcwimmer",
    "github_project": "wodoo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "wodoo"
}
        
Elapsed time: 0.46783s