Coder Social home page Coder Social logo

tecnativa / doodba Goto Github PK

View Code? Open in Web Editor NEW
424.0 66.0 301.0 674 KB

Base image for making the creation of customized Odoo environments a piece of cake

License: Apache License 2.0

Shell 4.34% Python 50.26% Dockerfile 45.40%
odoo docker doodba hacktoberfest

doodba's Introduction

ci

Doodba stands for Docker Odoo Base, and it is a highly opinionated image ready to put Odoo inside it, but without Odoo.

What?

Yes, the purpose of this is to serve as a base for you to build your own Odoo project, because most of them end up requiring a big amount of custom patches, merges, repositories, etc. With this image, you have a collection of good practices and tools to enable your team to have a standard Odoo project structure.

BTW, we use Debian. I hope you like that.

Why?

Because developing Odoo is hard. You need lots of customizations, dependencies, and if you want to move from one version to another, it's a pain.

Also because nobody wants Odoo as it comes from upstream, you most likely will need to add custom patches and addons, at least, so we need a way to put all together and make it work anywhere quickly.

How?

You can start working with this straight away with our template.

Image usage

Basically, every directory you have to worry about is found inside /opt/odoo. This is its structure:

custom/
    entrypoint.d/
    build.d/
    conf.d/
    ssh/
        config
        known_hosts
        id_rsa
        id_rsa.pub
    dependencies/
        apt_build.txt
        apt.txt
        gem.txt
        npm.txt
        pip.txt
    src/
        private/
        odoo/
        addons.yaml
        repos.yaml
common/
    entrypoint.sh
    build.sh
    entrypoint.d/
    build.d/
    conf.d/
auto
    addons/
    odoo.conf

Let's go one by one.

/opt/odoo/custom: The important one

Here you will put everything related to your project.

/opt/odoo/custom/entrypoint.d

Any executables found here will be run when you launch your container, before running the command you ask.

/opt/odoo/custom/build.d

Executables here will be aggregated with those in /opt/odoo/common/build.d.

The resulting set of executables will then be sorted alphabetically (ascending) and then subsequently run.

/opt/odoo/custom/conf.d

Files here will be environment-variable-expanded and concatenated in /opt/odoo/auto/odoo.conf in the entrypoint.

/opt/odoo/custom/ssh

It must follow the same structure as a standard ~/.ssh directory, including config and known_hosts files. In fact, it is completely equivalent to ~root/.ssh.

The config file can contain IdentityFile keys to represent the private key that should be used for that host. Unless specified otherwise, this defaults to identity[.pub], id_rsa[.pub] or id_dsa[.pub] files found in this same directory.

This is very useful to use deployment keys that grant git access to your private repositories.

Example - a private key file in the ssh folder named my_private_key for the host repo.example.com would have a config entry similar to the below:

Host repo.example.com
  IdentityFile ~/.ssh/my_private_key

Or you could just drop the key in id_rsa and id_rsa.pub files and it should work by default without the need of adding a config file.

Host key checking is enabled by default, which means that you also need to provide a known_hosts file for any repos that you wish to access via SSH.

In order to disable host key checks for a repo, your config would look something like this:

Host repo.example.com
  StrictHostKeyChecking no

For additional information regarding this directory, take a look at this Digital Ocean Article.

/opt/odoo/custom/src

Here you will put the actual source code for your project.

When putting code here, you can either:

  • Use repos.yaml, that will fill anything at build time.
  • Directly copy all there.

Recommendation: use repos.yaml for everything except for private, and ignore in your .gitignore and .dockerignore files every folder here except private, with rules like these:

odoo/custom/src/*
!odoo/custom/src/private
!odoo/custom/src/*.*
/opt/odoo/custom/src/odoo

REQUIRED. The source code for your odoo project.

You can choose your Odoo version, and even merge PRs from many of them using repos.yaml. Some versions you might consider:

  • Original Odoo, by Odoo S.A..

  • OCB (Odoo Community Backports), by OCA. The original + some features - some stability strictness.

  • OpenUpgrade, by OCA. The original, frozen at new version launch time + migration scripts.

/opt/odoo/custom/src/private

REQUIRED. Folder with private addons for the project.

/opt/odoo/custom/src/repos.yaml

A git-aggregator configuration file.

It should look similar to this:

# Odoo must be in the `odoo` folder for Doodba to work
odoo:
  defaults:
    # This will use git shallow clones.
    # $DEPTH_DEFAULT is 1 in test and prod, but 100 in devel.
    # $DEPTH_MERGE is always 100.
    # You can use any integer value, OTOH.
    depth: $DEPTH_MERGE
  remotes:
    origin: https://github.com/OCA/OCB.git
    odoo: https://github.com/odoo/odoo.git
    openupgrade: https://github.com/OCA/OpenUpgrade.git
  # $ODOO_VERSION is... the Odoo version! "11.0" or similar
  target: origin $ODOO_VERSION
  merges:
    - origin $ODOO_VERSION
    - odoo refs/pull/25594/head # Expose `Field` from search_filters.js

web:
  defaults:
    depth: $DEPTH_MERGE
  remotes:
    origin: https://github.com/OCA/web.git
    tecnativa: https://github.com/Tecnativa/partner-contact.git
  target: origin $ODOO_VERSION
  merges:
    - origin $ODOO_VERSION
    - origin refs/pull/1007/head # web_responsive search
    - tecnativa 11.0-some_addon-custom # Branch for this customer only
Automatic download of repos

Doodba is smart enough to download automatically git repositories even if they are missing in repos.yaml. It will happen if it is used in addons.yaml, except for the special private repo. This will help you keep your deployment definitions DRY.

You can configure this behavior with these environment variables (default values shown):

  • DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git"
  • DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git"

As you probably guessed, we use something like str.format(repo_basename) on top of those variables to compute the default remote origin. If, i.e., you want to use your own repositories as default remotes, just add these build arguments to your docker-compose.yaml file:

# [...]
services:
  odoo:
    build:
      args:
        DEFAULT_REPO_PATTERN: &origin "https://github.com/Tecnativa/{}.git"
        DEFAULT_REPO_PATTERN_ODOO: *origin
# [...]

So, for example, if your repos.yaml file is empty and your addons.yaml contains this:

server-tools:
  - module_auto_update

A /opt/odoo/auto/repos.yaml file with this will be generated and used to download git code:

/opt/odoo/custom/src/odoo:
  defaults:
    depth: $DEPTH_DEFAULT
  remotes:
    origin: https://github.com/OCA/OCB.git
  target: origin $ODOO_VERSION
  merges:
    - origin $ODOO_VERSION
/opt/odoo/custom/src/server-tools:
  defaults:
    depth: $DEPTH_DEFAULT
  remotes:
    origin: https://github.com/OCA/server-tools.git
  target: origin $ODOO_VERSION
  merges:
    - origin $ODOO_VERSION

All of this means that, you only need to define the git aggregator spec in repos.yaml if anything diverges from the standard:

  • You need special merges.
  • You need a special origin.
  • The folder name does not match the origin pattern.
  • The branch name does not match $ODOO_VERSION.
  • Etc.
/opt/odoo/custom/src/addons.yaml

One entry per repo and addon you want to activate in your project. Like this:

website:
  - website_cookie_notice
  - website_legal_page
web:
  - web_responsive

Advanced features:

  • You can bundle several YAML documents if you want to logically group your addons and some repos are repeated among groups, by separating each document with ---.

  • Addons under private and odoo/addons are linked automatically unless you specify them.

  • You can use ONLY to supply a dictionary of environment variables and a list of possible values to enable that document in the matching environments.

  • You can use ENV to supply a dictionary of environment variables to be used on downloading repositories. Following variables are supported:

    • DEFAULT_REPO_PATTERN
    • DEFAULT_REPO_PATTERN_ODOO
    • DEPTH_DEFAULT
    • ODOO_VERSION - can be used as repository branch
  • If an addon is found in several places at the same time, it will get linked according to this priority table:

    1. Addons in private.
    2. Addons in other repositories (in case one is matched in several, it will be random, BEWARE!). Better have no duplicated names if possible.
    3. Core Odoo addons from odoo/addons.
  • If an addon is specified but not available at runtime, it will fail silently.

  • You can use any wildcards supported by Python's glob module.

The following example shows these advanced features:

# Spanish Localization
l10n-spain:
  - l10n_es # Overrides built-in l10n_es under odoo/addons
server-tools:
  - "*date*" # All modules that contain "date" in their name
  - auditlog
web:
  - "*" # All web addons
---
# Different YAML document to separate SEO Tools
website:
  - website_blog_excertp_img
server-tools: # Here we repeat server-tools, but no problem because it's a
  # different document
  - html_image_url_extractor
  - html_text
---
# Enable demo ribbon only for devel and test environments
ONLY:
  PGDATABASE: # This environment variable must exist and be in the list
    - devel
    - test
web:
  - web_environment_ribbon
---
# Enable special authentication methods only in production environment
ONLY:
  PGDATABASE:
    - prod
server-tools:
  - auth_*
---
# Custom repositories
ENV:
  DEFAULT_REPO_PATTERN: https://github.com/Tecnativa/{}.git
  ODOO_VERSION: 16.0-new-feature
some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 15.0-new-feature
  - some_custom_module
/opt/odoo/custom/dependencies/*.txt

Files to indicate dependencies of your subimage, one for each of the supported package managers:

  • apt_build.txt: build-time dependencies, installed before any others and removed after all the others too. Usually these would include Debian packages such as build-essential or python-dev. From Doodba 11.0, this is most likely not needed, as build dependencies are shipped with the image, and local python develpment headers should be used instead of those downloaded from apt.
  • apt.txt: run-time dependencies installed by apt.
  • gem.txt: run-time dependencies installed by gem.
  • npm.txt: run-time dependencies installed by npm.
  • pip.txt: a normal pip requirements.txt file, for run-time dependencies too. It will get executed with --update flag, just in case you want to overwrite any of the pre-bundled dependencies.

/opt/odoo/common: The useful one

This folder is full of magic. I'll document it some day. For now, just look at the code.

Only some notes:

  • Will compile your code with [PYTHONOPTIMIZE=""][] by default.

  • Will remove all code not used from the image by default (not listed in /opt/odoo/custom/src/addons.yaml), to keep it thin.

/opt/odoo/auto: The automatic one

This directory will have things that are automatically generated at build time.

/opt/odoo/auto/addons

It will be full of symlinks to the addons you selected in addons.yaml.

/opt/odoo/auto/odoo.conf

It will have the result of merging all configurations under /opt/odoo/{common,custom}/conf.d/, in that order.

The Dockerfile

I will document all build arguments and environment variables some day, but for now keep this in mind:

  • This is just a base image, full of tools. You need to build your project subimage from this one, even if your project's Dockerfile only contains these 2 lines:

    FROM tecnativa/doodba
    MAINTAINER Me <[email protected]>
    
  • The above sentence becomes true because we have a lot of ONBUILD sentences here, so at least your project must have a ./custom folder along with its Dockerfile for it to work.

  • All should be magic if you adhere to our opinions here. Just put the code where it should go, and relax.

Bundled tools

There is a good collections of tools available in the image that help dealing with Odoo and its peculiarities:

addons

A handy CLI tool to automate addon management based on the current environment. It allows you to install, update, test and/or list private, extra and/or core addons available to current container, based on current addons.yaml configuration.

Call addons --help for usage instructions.

click-odoo and related scripts

The great click-odoo scripting framework and the collection of scripts found in click-odoo-contrib are included. Refer to their sites to know how to use them.

* Note: This replaces the deprecated python-odoo-shell binary.

The CLI text editor we all know, just in case you need to inspect some bug in hot deployments.

log

Just a little shell script that you can use to add logs to your build or entrypoint scripts:

log INFO I'm informing

pot

Little shell shortcut for exporting a translation template from any addon(s). Usage:

pot my_addon,my_other_addon

Environment variables are there so that if you need to connect with the database, you just need to execute:

docker-compose run -l traefik.enable=false --rm odoo psql

The same is true for any other Postgres client applications.

Enables hot code reloading when odoo is started with --dev and passed reload or all as an argument.

copier template enables this by default in the development environment.

Doodba supports this feature under versions 11.0 and later. Check CLI docs for details.

VSCode debugger. If you use this editor with its python module, you will find it useful.

To debug at a certain point of the code, add this Python code somewhere:

import debugpy
debugpy.listen(6899)
print("Waiting for debugger attach")
debugpy.wait_for_client()
debugpy.breakpoint()
print('break on this line')

To start Odoo within a debugpy environment, which will obey the breakpoints established in your IDE (but will work slowly), just add -e DEBUGPY_ENABLE=1 to your odoo container.

If you use the official template, you can boot it in debugpy mode with:

export DOODBA_DEBUGPY_ENABLE=1
docker-compose -f devel.yaml up -d

Of course, you need to have properly configured your VSCode. To do so, make sure in your project there is a .vscode/launch.json file with these minimal contents:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Attach to debug in devel.yaml",
      "type": "python",
      "request": "attach",
      "pathMappings": [
        {
          "localRoot": "${workspaceRoot}/odoo",
          "remoteRoot": "/opt/odoo"
        }
      ],
      "port": 6899,
      "host": "localhost"
    }
  ]
}

Then, execute that configuration as usual.

This is another great debugger that includes remote debugging via telnet, which can be useful for some cases, or for people that prefer it over wdb.

To use it, inject this in any Python script:

import pudb.remote
pudb.remote.set_trace(term_size=(80, 24))

Then open a telnet connection to it (running in 0.0.0.0:6899 by default).

It is safe to use in production environments if you know what you are doing and do not expose the debugging port to attackers. Usage:

docker-compose exec odoo telnet localhost 6899

We found this one to be the most useful tool for downlading code, merging it and placing it somewhere.

autoaggregate

This little script wraps git-aggregator to make it work fine and automatically with this image. Used in the template's setup-devel.yaml step.

Example repos.yaml file

This repos.yaml example merges several sources:

./odoo:
  defaults:
    # Shallow repositores are faster & thinner. You better use
    # $DEPTH_DEFAULT here when you need no merges.
    depth: $DEPTH_MERGE
  remotes:
    ocb: https://github.com/OCA/OCB.git
    odoo: https://github.com/odoo/odoo.git
  target: ocb $ODOO_VERSION
  merges:
    - ocb $ODOO_VERSION
    - odoo refs/pull/13635/head
  shell_command_after:
    # Useful to merge a diff when there's no git history correlation
    - curl -sSL https://github.com/odoo/odoo/pull/37187.diff | patch -fp1

We set an $OPENERP_SERVER environment variable pointing to the autogenerated configuration file so you don't have to worry about it. Just execute odoo and it will work fine.

Note that version 9.0 has an odoo binary to provide forward compatibility (but it has the odoo.py one too).

Subproject template

That's a big structure! Get it up and running quickly using the copier template we provide to help you generate your subproject.

Check its docs to know how to use it.

FAQ

Will there be not retrocompatible changes on the image?

This image is production-ready, but it is constantly evolving too, so some new features can break some old ones, or conflict with them, and some old features might get deprecated and removed at some point.

The best you can do is to subscribe to the compatibility breakage announcements issue.

This project is too opinionated, but can I question any of those opinions?

Of course. There's no guarantee that we will like it, but please do it. 😉

What's this hooks folder here?

It runs triggers when doing the automatic build in the Docker Hub. Check this.

How can I pin an image version?

Version-pinning is a good idea to keep your code from differing among image updates. It's the best way to ensure no updates got in between the last time you checked the image and the time you deploy it to production.

You can do it through its sha256 code.

Get any image's code through inspect, running from a computer where the correct image version is downloaded:

docker image inspect --format='{{.RepoDigests}}' tecnativa/doodba:10.0-onbuild

Alternatively, you can browse this image's builds, click on the one you know it works fine for you, and search for the digest word using your browser's search in page system (Ctrl+F usually).

You will find lines similar to:

[...]
10.0: digest: sha256:fba69478f9b0616561aa3aba4d18e4bcc2f728c9568057946c98d5d3817699e1 size: 4508
[...]
8.0: digest: sha256:27a3dd3a32ce6c4c259b4a184d8db0c6d94415696bec6c2668caafe755c6445e size: 4508
[...]
9.0: digest: sha256:33a540eca6441b950d633d3edc77d2cc46586717410f03d51c054ce348b2e977 size: 4508
[...]

Once you find them, you can use that pinned version in your builds, using a Dockerfile similar to this one:

# Hash-pinned version of tecnativa/doodba:10.0-onbuild
FROM tecnativa/doodba@sha256:fba69478f9b0616561aa3aba4d18e4bcc2f728c9568057946c98d5d3817699e1

How can I help?

Just head to our project and open a discussion, issue or pull request.

Related Projects

doodba's People

Contributors

ap-wtioit avatar carlosdauden avatar celm1990 avatar chienandalu avatar crimoniv avatar dependabot[bot] avatar gdgellatly avatar hhgabelgaard avatar joao-p-marques avatar josep-tecnativa avatar lasley avatar loisrforgeflow avatar manuel-florido avatar obayit avatar pabloeforgeflow avatar pcatinean avatar pedrobaeza avatar remi-filament avatar tardo avatar theangryangel avatar yajo avatar yelizariev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doodba's Issues

Use --internal with sane defaults in scaffoldings

It's interesting that in the scaffolding there has been the fakeinbox and fakesmtp containers made to isolate restored backups in devel/test environments from making requests to the outside world, specifically when attempting to contact servers.

However, it turns out that since Docker 1.10, we can create networks with the --internal flag, which restricts access to the outside world perfectly fine (see moby/moby#19276).

We can use that instead of using some of the proxies. It should be easier to understand for newcomers, and easier to maintain for oldcomers.

Possible error with repos.yaml and/or addons.yaml

May be isn't an error, and i not using correctly the docker-compose YAML file.

I have these files:

./odoo/custom/src/repos.yaml

# Odoo is always required
./odoo:
    defaults:
        # Shallow repositories ($DEPTH_DEFAULT=1) are faster & thinner
        # You may need a bigger depth when merging PRs
        depth: $DEPTH_DEFAULT
    remotes:
        ocb: https://github.com/OCA/OCB.git
    target:
        ocb $ODOO_VERSION
    merges:
        - ocb $ODOO_VERSION
        # Example of a merge of the PR with the number <PR>
        # - oca refs/pull/<PR>/head

# l10n-es
./l10n-es:
    defaults:
        depth: $DEPTH_DEFAULT
    remotes:
        oca: https://github.com/OCA/l10n-spain.git
    target:
        oca $ODOO_VERSION
    merges:
        - oca $ODOO_VERSION
        # Example of a merge of the PR with the number <PR>
        # - oca refs/pull/<PR>/head

# server-tools
./server-tools:
    defaults:
        depth: $DEPTH_DEFAULT
    remotes:
        oca: https://github.com/OCA/server-tools.git
    target:
        oca $ODOO_VERSION
    merges:
        - oca $ODOO_VERSION
        # Example of a merge of the PR with the number <PR>
        # - oca refs/pull/<PR>/head

# website
./website:
    defaults:
        depth: $DEPTH_DEFAULT
    remotes:
        oca: https://github.com/OCA/website.git
    target:
        oca $ODOO_VERSION
    merges:
        - oca $ODOO_VERSION
        # Example of a merge of the PR with the number <PR>
        # - oca refs/pull/<PR>/head

./odoo/custom/src/addons.yaml

# Spanish Localization
l10n-spain: all
#    - l10n_es
server-tools: all
#    - date_range
---
# SEO tools
website: all
#    - website_blog_excertp_img
server-tools: all
                # Here we repeat server-tools, but no problem because it's a
                # different document
#    - html_image_url_extractor
#    - html_text

In setup-devel.yaml, I changed:

...
            context: ./odoo
            args:
                AGGREGATE: "false"
                DEPTH_DEFAULT: 10
...
        environment:
            DEPTH_DEFAULT: 10

And i executed the docker-compose commands in the follow order:

$ docker-compose -f setup-devel.yaml run --rm odoo
$ docker-compose -f devel.yaml up --build

I getted this output for the first command:

$ docker-compose -f setup-devel.yaml run --rm odoo
Building odoo
Step 1/1 : FROM tecnativa/odoo-base:10.0
# Executing 27 build triggers...
....
Successfully built 2eeaf284dc4b
Successfully tagged ocbandallocarepos_odoo:latest
WARNING: Image for service odoo was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
INFO 18:48:1494528490 Aggregating repositories from /opt/odoo/custom/src/repos.yaml
(INFO) [18:05:10] git_aggregator.repo  Start aggregation of /opt/odoo/custom/src/odoo
(INFO) [18:05:10] git_aggregator.repo  Init empty git repository in /opt/odoo/custom/src/odoo
Initialized empty Git repository in /opt/odoo/custom/src/odoo/.git/
(INFO) [18:05:10] git_aggregator.repo  Switch to branch 10.0
Switched to a new branch '10.0'
(INFO) [18:05:10] git_aggregator.repo  Adding remote ocb <https://github.com/OCA/OCB.git>
(INFO) [18:05:10] git_aggregator.repo  Fetching required remotes
....
 * [new branch]      10.0       -> oca/10.0
(INFO) [18:05:18] git_aggregator.repo  Pull oca, 10.0
(INFO) [18:05:20] git_aggregator.repo  Execute shell after commands
(INFO) [18:05:20] git_aggregator.repo  End aggregation of /opt/odoo/custom/src/website

and this output for the second:

 $ docker-compose -f devel.yaml up --build
Creating volume "ocbandallocarepos_filestore10" with default driver
Creating volume "ocbandallocarepos_db10" with default driver
Building odoo
Step 1/1 : FROM tecnativa/odoo-base:10.0
# Executing 27 build triggers...
Step 1/1 : ARG AGGREGATE=true
 ---> Using cache
...
Step 1/1 : ARG LOG_LEVEL=20
 ---> Running in 1aeb33e77a70
Step 1/1 : RUN /opt/odoo/common/build.sh
 ---> Running in 6b14073412c6
INFO 19:59:1494532794 Executing contents of /opt/odoo/custom/build.d
INFO 19:59:1494532794 Executing contents of /opt/odoo/common/build.d
WARNING 19:59:1494532794 Not aggregating code repositories
INFO:root:Linking all addons from /opt/odoo/custom/src/addons.yaml in /opt/odoo/auto/addons
Traceback (most recent call last):
  File "/opt/odoo/common/build.d/30-addons-link", line 20, in <module>
    addons = os.listdir(os.path.join(odoobaselib.SRC_DIR, repo))
OSError: [Errno 2] No such file or directory: '/opt/odoo/custom/src/website'
run-parts: /opt/odoo/common/build.d/30-addons-link exited with return code 1
ERROR: Service 'odoo' failed to build: The command '/opt/odoo/common/build.sh' returned a non-zero code: 1

Regards.

Go back to Alpine

This is a placeholder to track all progress on why we went away from Alpine base and how we could get back.

Why do we want it back?

  • Base Debian image is ~123MB, base Alpine one is ~4MB. (TODO: Is it worth it? After all Odoo has such a big amount of dependencies...)
  • apk (Alpine package manager) allows virtual packages, which make the Dockerfile much more straightforward.

Why did we leave it?

Where did we leave it?

Right now, there's the alpine tag, that holds the last commit that was Alpine-based.

Workarounds available

Who's the culprit?

Some C library, possibly.

Use a better fakesmtp

Current fakesmtp just logs "a mail has been sent". Not very useful for development.

https://github.com/mailhog/MailHog seems to be a better default for that purpose. Maybe there are others? They have an official docker image; it should be easy to plug in the scaffolding.

Installing NPM Packages

Hello;

I'm not able to install 'quagga' from 'npm.
In '/opt/odoo/custom/dependencies/', following 'pip.txt' way; I add a line with 'quagga' to 'npm.txt' file.
Unfortunately, 'quagga' is not installed.

I attache image with 'log'.

log

Regards;

Reduce permission change verbosity

Current builds are too verbose when changing owners and permissions of files. That was useful when the project was less stable, but let's remove that because it disturbs some users.

Use dev enviroment with git repos

The private folder is intended to directly save the modules (not a repository), and the repos folders are rebuilt every time we launch the docker-compose -f setup-devel run... overwriting any change that you do not have uploaded to the repository.
If I'm developing in local with git repo, I must use the private folder?... other volume?

Thanks!

Change "yes" and "no" for "true" and "false"

Currently using yes and no in some environment variables causes misbehavior.

For example, the WITHOUT_DEMO variable. When passing no, Odoo stores a no string instead of a false bool.

This could break some deployments where a yes was being used, so beware those out there.

Broken build with "text file busy"

Current master build is failing with this log:

Traceback (most recent call last):
  File "/opt/odoo/common/build", line 26, in <module>
    subprocess.check_call(command)
  File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 26] Text file busy
ERROR: Service 'odoo' failed to build: The command '/opt/odoo/common/build' returned a non-zero code: 1

Failure is a little bit random, but happens often. A possible workaround is to sync after chmod as explained in moby/moby#9547 (comment).

Adding permissions for repo directories

Sometimes Odoo needs write access to certain repo directories, such as in the instance of the static directory in Runbot.

One would assume that by creating a script in build.d with a numeric ordering after the repo aggregation in order to set the perms, it would be run after that.

It seems however that the whole custom build directory is run before the one included here, so the permission editing attempt takes place before the repos are aggregated into the directory. Is there a reasoning for this, or am I simply doing something wrong?

Dependencies for Pillow (Debian stretch)

I was having trouble installing Pillow using buildout. FYI, here I found libs that are required:
https://github.com/python-pillow/docker-images/blob/master/debian-stretch-x86/Dockerfile

apt-get -y
install xvfb sudo
git wget python-numpy python-scipy netpbm
python-qt4 ghostscript libffi-dev libjpeg-turbo-progs
python-setuptools python-virtualenv
python-dev python3-dev cmake
libtiff5-dev libjpeg62-turbo-dev zlib1g-dev
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev
python-tk python3-tk

it cant build

Step 1/1 : FROM tecnativa/odoo-base:10.0
10.0: Pulling from tecnativa/odoo-base
Digest: sha256:8d22ca6a503f9258a6ff1e12d05900636f20910124f8defc41a078e541ba6348
Status: Image is up to date for tecnativa/odoo-base:10.0
�[91m# Executing 27 build triggers...
�[0mStep 1/1 : ENTRYPOINT /opt/odoo/common/entrypoint
 ---> Using cache
Step 1/1 : CMD /usr/local/bin/odoo
 ---> Using cache
Step 1/1 : ARG AGGREGATE=true
 ---> Using cache
Step 1/1 : ARG AUTO_REQUIREMENTS=false
 ---> Using cache
Step 1/1 : ARG DEPTH_DEFAULT=1
 ---> Using cache
Step 1/1 : ARG DEPTH_MERGE=100
 ---> Using cache
Step 1/1 : ARG CLEAN=true
 ---> Using cache
Step 1/1 : ARG COMPILE=true
 ---> Using cache
Step 1/1 : ARG CONFIG_BUILD=true
 ---> Using cache
Step 1/1 : ARG PIP_INSTALL_ODOO=true
 ---> Using cache
Step 1/1 : ARG ADMIN_PASSWORD=admin
 ---> Using cache
Step 1/1 : ARG SMTP_SERVER=smtp
 ---> Using cache
Step 1/1 : ARG PROXY_MODE=false
 ---> Using cache
Step 1/1 : ARG WITHOUT_DEMO=all
 ---> Using cache
Step 1/1 : ARG PYTHONOPTIMIZE=1
 ---> Using cache
Step 1/1 : ENV PYTHONOPTIMIZE "$PYTHONOPTIMIZE"
 ---> Using cache
Step 1/1 : ARG PGUSER=odoo
 ---> Using cache
Step 1/1 : ARG PGPASSWORD=odoopassword
 ---> Using cache
Step 1/1 : ARG PGHOST=db
 ---> Using cache
Step 1/1 : ARG PGDATABASE=prod
 ---> Using cache
Step 1/1 : ENV ADMIN_PASSWORD "$ADMIN_PASSWORD" UNACCENT "$UNACCENT" PGUSER "$PGUSER" PGPASSWORD "$PGPASSWORD" PGHOST "$PGHOST" PGDATABASE "$PGDATABASE" PROXY_MODE "$PROXY_MODE" SMTP_SERVER "$SMTP_SERVER" WITHOUT_DEMO "$WITHOUT_DEMO"
 ---> Using cache
Step 1/1 : ARG LOCAL_CUSTOM_DIR=./custom
 ---> Using cache
Step 1/1 : COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom
 ---> Using cache
Step 1/1 : ARG LOG_LEVEL=INFO
 ---> Using cache
Step 1/1 : RUN mkdir -p /opt/odoo/custom/ssh             && ln -s /opt/odoo/custom/ssh ~root/.ssh             && chmod -R u=rwX,go= /opt/odoo/custom/ssh             && sync
 ---> Using cache
Step 1/1 : RUN /opt/odoo/common/build && sync
 ---> Running in b876662326fa
�[91mTraceback (most recent call last):
  File "/opt/odoo/common/build", line 28, in <module>
    subprocess.check_call(command)
  File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
ERROR: Service 'odoo' failed to build: The command '/bin/sh -c /opt/odoo/common/build && sync' returned a non-zero code: 1
�[0m

SSH Keys for Private Repos

I am unable to get private repo SSH keys to work while building a scaffold. I've tried a lot of things, but the below is the most simple that definitely should have worked (it's in a build.d file):

#!/bin/bash
mkdir -p ~/.ssh
echo "RSA PRIVATE KEY" > ~/.ssh/id_rsa
echo "Host repo.laslabs.com
  IdentityFile ~/.ssh/id_rsa" > ~/.ssh/config
chmod 700 ~/.ssh/id_rsa

My guess here is that we aren't operating within a true shell, so the SSH config & key simply isn't being looked at.

I've also tried to add this logic in my scaffold Dockerfile, but that's a bust because it's run after the repos are gathered.

Are you guys using any private repos at this point?

build.d foregoes catching advantage?

Hi Jairo, I think using build.d technique forgoes the catching advantage of individual COPY file RUN file combinations, as the cache on copy validates the file hash. Something that docker cannot infer on your build.d script. For time intensive build instructions, this can be quite some annoyance. Or am I missing something?

Allow to list databases by default

Fixing #49 made a new problem: Traefik won't let you access /web/database/list (for android apps) and /web/database/selector (for normal browsing humans that have multiple databases).

Gotta fix that.

Update scaffolding to use system-wide inverse proxy

This will change the shape of the scaffolding.

  1. Use traefik since it seems the easiest way to set up a system-wide inverse proxy that allows multiple domains per node and container. It is also compatible with swarm mode just by adding a new flag, looking forward for #20.
  2. Update scaffolding with corresponding labels.
  3. Remove ACME variables not needed now.
  4. Update README.

[RFC] Move config generation to entrypoint

I wanted to open a discussion to move the Odoo configuration generation from the build into the entrypoint. I am mainly wondering what were the design considerations that led you to put it in the build?

My reasoning for entrypoint is as follows:

  • Passwords are currently hard coded into the build image
    • Security issue - passwords should not be stored in the container registry (note that ECR is not a HIPAA compliant service)
    • Maintenance issue - our policies require that all passwords are rotated on a consistent basis. This is much more difficult at the image level
    • Passwords stored in repo unencrypted (unless I'm missing something)
  • Exponential image duplication - It is possible to have multiple customers on the same image if the config is generated on the fly
    • This is particularly important in my SaaS, where all images are identical except for the credentials.

Ummm that's all I can think of at the moment. Any thoughts?

Possible error with tecnativa/odoo-base:10

I cloned the repo, branch scaffolding, as in the "quick guide":

git clone -b scaffolding https://github.com/Tecnativa/docker-odoo-base.git ocb-and-all-oca-repos
Clonar en «ocb-and-all-oca-repos»...
remote: Counting objects: 1356, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 1356 (delta 6), reused 19 (delta 4), pack-reused 1325
Receiving objects: 100% (1356/1356), 241.72 KiB | 0 bytes/s, done.
Resolving deltas: 100% (810/810), done.
Comprobando la conectividad… hecho.
$ cd ocb-and-all-oca-repos
$ ln -s devel.yaml docker-compose.yml
$ docker-compose build --pull
smtp uses an image, skipping
wdb uses an image, skipping
db uses an image, skipping
inbox uses an image, skipping
Building odoo
Step 1/1 : FROM tecnativa/odoo-base:10.0
10.0: Pulling from tecnativa/odoo-base
aa18ad1a0d33: Pull complete
83c2ca70d25d: Pull complete
767589c3ae5b: Pull complete
45f917242ff7: Pull complete
ec382c11036e: Pull complete
1590cc52bced: Pull complete
c833f2693ef1: Pull complete
ed81f87eb8fa: Pull complete
9ad0a7c006d3: Pull complete
bb76283ff010: Pull complete
3b12f1092ab9: Pull complete
f3be112150a1: Pull complete
fa2369f48020: Pull complete
44d442c24251: Pull complete
0fd9ea64ab24: Pull complete
f857b4b3f64b: Pull complete
c8fdda65ddd7: Pull complete
Digest: sha256:586a33b2842b73f7ef348c4e9c3c1d9b504e44ebc7d065dceda420c0d696087f
Status: Downloaded newer image for tecnativa/odoo-base:10.0
# Executing 26 build triggers...
Step 1/1 : ENTRYPOINT /opt/odoo/common/entrypoint
 ---> Running in 90fcf07dabba
Step 1/1 : CMD /usr/local/bin/odoo
 ---> Running in 7ff4f08c3d3e
Step 1/1 : ARG AGGREGATE=true
 ---> Running in cc4161d18caa
Step 1/1 : ARG DEPTH_DEFAULT=1
 ---> Running in 0f3f1b149aa2
Step 1/1 : ARG DEPTH_MERGE=100
 ---> Running in 8b25dbdbbaaf
Step 1/1 : ARG CLEAN=true
 ---> Running in d06ea2ee17d0
Step 1/1 : ARG COMPILE=true
 ---> Running in 2439778b5127
Step 1/1 : ARG CONFIG_BUILD=true
 ---> Running in 956d427ee1a8
Step 1/1 : ARG PIP_INSTALL_ODOO=true
 ---> Running in 2de5f7a16037
Step 1/1 : ARG ADMIN_PASSWORD=admin
 ---> Running in 0424878f5121
Step 1/1 : ARG SMTP_SERVER=smtp
 ---> Running in 0a479a334720
Step 1/1 : ARG PROXY_MODE=false
 ---> Running in b07bef938888
Step 1/1 : ARG WITHOUT_DEMO=all
 ---> Running in 03c90e44487e
Step 1/1 : ARG PYTHONOPTIMIZE=1
 ---> Running in 3568f33a579d
Step 1/1 : ENV PYTHONOPTIMIZE "$PYTHONOPTIMIZE"
 ---> Running in 0cefe4380063
Step 1/1 : ARG PGUSER=odoo
 ---> Running in 93d89b188d60
Step 1/1 : ARG PGPASSWORD=odoopassword
 ---> Running in 435b9a5eb1f1
Step 1/1 : ARG PGHOST=db
 ---> Running in f2a95e9af646
Step 1/1 : ARG PGDATABASE=prod
 ---> Running in adc083da721c
Step 1/1 : ENV ADMIN_PASSWORD "$ADMIN_PASSWORD" UNACCENT "$UNACCENT" PGUSER "$PGUSER" PGPASSWORD "$PGPASSWORD" PGHOST "$PGHOST" PGDATABASE "$PGDATABASE" PROXY_MODE "$PROXY_MODE" SMTP_SERVER "$SMTP_SERVER" WITHOUT_DEMO "$WITHOUT_DEMO"
 ---> Running in 7c5e92f4a362
Step 1/1 : ARG LOCAL_CUSTOM_DIR=./custom
 ---> Running in 238cd27f62d0
Step 1/1 : COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom
Step 1/1 : ARG LOG_LEVEL=INFO
 ---> Running in f8dfad9c826a
Step 1/1 : RUN mkdir -p /opt/odoo/custom/ssh             && ln -s /opt/odoo/custom/ssh ~root/.ssh             && chmod -R u=rwX,go= /opt/odoo/custom/ssh             && sync
 ---> Running in 8f6ccd840852
Step 1/1 : RUN /opt/odoo/common/build
 ---> Running in 7cfb70f47382
INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/apt_build.txt
INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/npm.txt
INFO:docker-odoo-base:Executing: ['pip', 'install', '--upgrade', '--no-cache-dir', '-r', '/opt/odoo/custom/dependencies/pip.txt']
Collecting checksumdir (from -r /opt/odoo/custom/dependencies/pip.txt (line 1))
  Downloading checksumdir-1.1.4.tar.gz
Collecting unicodecsv (from -r /opt/odoo/custom/dependencies/pip.txt (line 2))
  Downloading unicodecsv-0.14.1.tar.gz
Collecting unidecode (from -r /opt/odoo/custom/dependencies/pip.txt (line 3))
  Downloading Unidecode-0.04.21-py2.py3-none-any.whl (228kB)
Collecting requests (from -r /opt/odoo/custom/dependencies/pip.txt (line 4))
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
Collecting xlsxwriter (from -r /opt/odoo/custom/dependencies/pip.txt (line 5))
  Downloading XlsxWriter-1.0.0-py2.py3-none-any.whl (139kB)
Requirement already up-to-date: idna<2.7,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests->-r /opt/odoo/custom/dependencies/pip.txt (line 4))
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in /usr/local/lib/python2.7/dist-packages (from requests->-r /opt/odoo/custom/dependencies/pip.txt (line 4))
Requirement already up-to-date: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests->-r /opt/odoo/custom/dependencies/pip.txt (line 4))
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests->-r /opt/odoo/custom/dependencies/pip.txt (line 4))
Installing collected packages: checksumdir, unicodecsv, unidecode, requests, xlsxwriter
  Running setup.py install for checksumdir: started
    Running setup.py install for checksumdir: finished with status 'done'
  Running setup.py install for unicodecsv: started
    Running setup.py install for unicodecsv: finished with status 'done'
  Found existing installation: requests 2.11.1
    Uninstalling requests-2.11.1:
      Successfully uninstalled requests-2.11.1
  Found existing installation: XlsxWriter 0.9.3
    Uninstalling XlsxWriter-0.9.3:
      Successfully uninstalled XlsxWriter-0.9.3
Successfully installed checksumdir-1.1.4 requests-2.18.4 unicodecsv-0.14.1 unidecode-0.4.21 xlsxwriter-1.0.0
INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/gem.txt
INFO:docker-odoo-base:No installable requirements found in /opt/odoo/custom/dependencies/apt.txt
WARNING:docker-odoo-base:Not aggregating code repositories
WARNING:docker-odoo-base:Not cleaning garbage
WARNING:docker-odoo-base:Not compiling Python code
WARNING:docker-odoo-base:Skipping Odoo config generation - will perform during entrypoint.
INFO:docker-odoo-base:Installing Odoo from /opt/odoo/custom/src/odoo
WARNING:docker-odoo-base:Blindly symlinking odoo executable
INFO:docker-odoo-base:No removable requirements found in /opt/odoo/custom/dependencies/apt_build.txt
INFO:docker-odoo-base:Executing: rm -Rf ~/.npm /tmp/*
INFO:docker-odoo-base:Executing: rm -Rf ~/.gem /var/lib/gems/*/cache/
Traceback (most recent call last):
  File "/opt/odoo/common/build", line 26, in <module>
    subprocess.check_call(command)
  File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
ERROR: Service 'odoo' failed to build: The command '/opt/odoo/common/build' returned a non-zero code: 1

OS, Docker and docker-compose versions:

$ lsb_release --all
LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	LinuxMint
Description:	Linux Mint 18.1 Serena
Release:	18.1
Codename:	serena
$ docker --version
Docker version 17.05.0-ce, build 89658be
$ docker-compose --version
docker-compose version 1.11.1, build 7c5d5e4

Allow sections in conf.d

Right now we concatenate all conf.d things in one, assuming only [options] section is used.

We should check if adding multiple [options] is a problem or not for Odoo.

Then, if it is, we should combine the configurations using a smarter script that joins all configurations for a given section inteligently. If it isn't, then add [options] at the top of each */conf.d/* file.

Commits on Master

Hey @yajo - Now that I'm starting to use this repo, I'm having a lot of trouble following what's happening due to commits directly on master. Can I ask for a PR process? I don't really care if they're reviewed or anything (although I offer a hand in that), but my workflow revolves pretty heavily around monitoring PRs and not actual commits.

Configurable 'addons path'

Hello;

In my opnion it could be interesting modify from 'scaffolding' the 'addons path' written in the image (tecnativa/odoo-base).

If you agree I can request for a PR.

Regards,

Protect critical paths in Odoo

These paths:

  • /web/database/*
  • /website/info

can be considered critical because they offer world-wide read access to data that some people can consider sensitive, such as database names and installed addon names.

Not exactly fully critical, but can make some attacks easier.

Security patch will land in the scaffolding to protect these by default, by asking HTTP auth where you will have to know the odoo database user and the admin password to get read access there, getting benefit of recently landed feature in Traefik (traefik/traefik#1147).

It should only affect production.

[Discussion] Test execution

I find MQT quite handy up to certain extent (it's a monolithic metamorph) in order to execute testing, however preparing my local test bed is a pain and I am split brain among improving MQT or factoring out part of its' ideas into something like what you started here.

What I like:

  • Being able to build a template DB to speed things up
  • Being able to autodetect changes via a git reflog analysis, so it at leasts always tests automatically the modules I touched.
  • Keeping DB up and running, so it can soon double up as a more Standard-CI/CD friendly runbot replacement.

What I don't like there:

  • Architecture and design are somewhat erratic and constantly changing.
  • It has the OCA way in mind without being too much extensible
  • A point I don't want to speak publically about 😸 - ok it has to do with time investment and iterations...

So the question is: "make or buy"? (or drop, obviously)

Install and Update Addons In Host DB

The next feature I am looking to add here is the automatic installation and update of addons that are defined in the addons.yml.

Only reason I'm making this issue TBH is that I can't figure out exactly where you are creating the Odoo DB.

My searches lead me here, but I'm pretty sure I'm totally off. Would you mind enlightening me please so that I can submit a shiny new PR?

Rename config files to "sample" files

I think that is much better to rename the different config files on the scaffolding, to a ".sample." files, for get the repo clean and allow an easy update of this (as a submodule of another project, for example).

I go to explain this a little better.

I have right now, one repo, with this directory structure:

.
├── docker
│   ├── common.yaml
│   ├── devel.yaml
│   ├── docker-compose.yml -> devel.yaml
│   ├── inverseproxy.yaml
│   ├── LICENSE
│   ├── odoo
│   │   ├── auto
│   │   │   └── addons
│   │   ├── custom
│   │   │   ├── build.d
│   │   │   ├── conf.d
│   │   │   ├── dependencies
│   │   │   ├── entrypoint.d
│   │   │   ├── src
│   │   │   └── ssh
│   │   └── Dockerfile
│   ├── prod.yaml
│   ├── README.md
│   ├── setup-devel.yaml
│   ├── src -> ./odoo/custom/src/
│   └── test.yaml
└── README.md

the "docker" folder, is a submodule (git submodule add [email protected]:Tecnativa/docker-odoo-base.git ./docker); but, logically, i have to configure same files for my custom installation; there are (i put them refered to the tecnativa odoo base docker scaffolding):

./odoo/Dockerfile
./odoo/custom/dependencies/apt_build.txt
./odoo/custom/dependencies/apt.txt
./odoo/custom/dependencies/gem.txt
./odoo/custom/dependencies/npm.txt
./odoo/custom/dependencies/pip.txt
./odoo/custom/src/addons.yaml
./odoo/custom/src/repos.yaml
./odoo/custom/ssh/config
./odoo/custom/ssh/id_rsa
./odoo/custom/ssh/id_rsa.pub
./odoo/custom/ssh/known_hosts

With all of these files commited, if i change any of this, for my own needs, like.. Simply, install the prestapyt python module, for example (has to be on the pip.txt), i will can't make a pull after that.

If the versioned files were something like this:

./odoo/Dockerfile.sample
./odoo/custom/dependencies/apt_build.txt.sample
./odoo/custom/dependencies/apt.txt.sample
./odoo/custom/dependencies/gem.txt.sample
./odoo/custom/dependencies/npm.txt.sample
./odoo/custom/dependencies/pip.txt.sample
./odoo/custom/src/addons.yaml.sample
./odoo/custom/src/repos.yaml.sample
./odoo/custom/ssh/config.sample
./odoo/custom/ssh/id_rsa.sample
./odoo/custom/ssh/id_rsa.pub.sample
./odoo/custom/ssh/known_hosts.sample

And has entries for the really config files mentioned above on the .gitignore of the repo, all of us can adapt the repo to our needs, and not have to get the config files, get outside repo, make the pull of the repo, and put into repo the config files again.

The YAML docker-compose files don't need something like that, because in the scaffolding aren't a docker-compose.yml file (the README say that we have to make a simbolic link).

What do you think?

If you like, i can make a PR.

Regards.

PD: may be useful un bash script to rename or copy the .sample files renamed into their locations. I can make it too, if you like.

add db-filter as parameter to odoo initialization

Hi, I need to add the db-filter option to command line execution, what would be the best way to do it? I've added a db_filter="^%d$" in custom/conf.d/10-multidb.conf and it is creating the expected key value in the auto conf but seems like I need to add the --db-filter option in the startup parameter also.

Big git disk usage in development machines

When one deals with many projects based on this one in a development computer, git tends to use too much disk, as you can see in this graph:

captura de pantalla de 2017-07-25 13-33-13

This happens because of the way it is getting cloned, downloading code in the setup-devel.yaml environment each time from github or other repos.

It would be great to support having a local mirror of those repositories, so you don't have to download them each time. Besides, when cloning locally, git uses hard links, which leave the same files but uses the same disk space. I think the requirement would be that both must reside in the same partition. Not sure how would that affect a docker-based environment as it is right now.

Otherwise we could provide instructions on how to re-shallow your repositories to remove additional remotes, branches, pointers, and other git garbage, so we can run this command on these repos and get back some disk space.

Question on License

Any thoughts on licensing this under MIT or BSD? I'd prefer to not have any of my infrastructure under (*)GPL if at all possible, even if it is hosting an LGPL app.

Note: the Python base & Postgres sidekick are MIT

Avoid random segfaults

Seems like some of Odoo dependencies needs glibc, possibly Pillow: python-pillow/Pillow#1935.

To reproduce, just run the scaffolding for v10, install account_accountant addon, and go to Account menu. Odoo simply dies with exit code 139. No exceptions, no traceback, just dies.

According to above issue, it seems like possibly Pillow or some of its dependencies (or Odoo's) needs something that it only can get from glibc, and is thus incompatible with musl.

We could try to use a glibc-enabled Alpine, but that does not seem too much stable and secure for production. I think for this case we will sadly need to use another distro. Let's try with debian.

Remove PYTHONOPTIMIZE=2 workarounds from install.sh

install.sh includes some workarounds for pip-installing some packages that don't support PYTHONOPTIMIZE=2 at install time or fail somehow.

"Fixing" those workarounds means removing them when Odoo depends on a version of the package that has these bugs fixed:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.