Giter Club home page Giter Club logo

doodba-scaffolding's Introduction

doodba-scaffolding's People

Contributors

ap-wtioit avatar loisrforgeflow avatar pedrobaeza avatar yajo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doodba-scaffolding's Issues

Error groupadd: GID '0' already exists

GID: "${GID:-1000}"

Hi I'm Oscar,
I have a little question. It is surely my fault. I have tried to instantiate an odoo 12.0 in production, with the root user. And when I launched the docker-compose -f prod.yaml build command I got the following error:
groupadd: GID '0' already exists
ERROR: Service 'odoo' failed to build
By this commit fa9a2e4 I understand that it is a matter of permissions. Is it possible that I have to up the instance without using root?
PD: I have commented on the two lines and it works.
But for me it is the closest thing to black magic. 😅

Big git disk usage in development machines

Copied from Tecnativa/doodba#54:


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.

Ease the secret creation in scaffolding

Just an idea really to quickly setup these files, have an executable python file in .

#!/usr/bin/env python3


if __name__ == '__main__':
    import os
    import secrets
    secrets_dir = '.docker'

    try:
        os.mkdir(secrets_dir, 0o700)
    except FileExistsError:
        print('.docker directory already exists ... exiting')
        exit(1)

    os.umask(0o177)

    with open(os.path.join(secrets_dir, 'odoo.env'), 'w+') as f:
        f.write(f'ADMIN_PASSWORD={secrets.token_urlsafe(10)}\n')

    pg_password = secrets.token_urlsafe(10)
    with open(os.path.join(secrets_dir, 'db-creation.env'), 'w+') as f:
        f.write(f'POSTGRES_PASSWORD={pg_password}\n')

    with open(os.path.join(secrets_dir, 'db-access.env'), 'w+') as f:
        f.write(f'PGPASSWORD={pg_password}\n')

    with open(os.path.join(secrets_dir, 'smtp.env'), 'w+') as f:
        f.write('MAIL_RELAY_PASS=\n')

    with open(os.path.join(secrets_dir, 'backup.env'), 'w+') as f:
        f.write(f'AWS_ACCESS_KEY_ID=\nAWS_SECRET_ACCESS_KEY\nPASSPHRASE={secrets.token_urlsafe(10)}')

    print(".docker skeleton file for doodba secrets created. Please edit at least "
          "smtp.env and backup.env with your environment specific details")

setup-devel.yaml reseting the checked-out branches

Not sure if this is really an issue:

If you checked-out different branches in the repos (i.e.: migrating some module) and run a setup-devel.yaml, the repo branch will be checkout back to the $ODOO_MINOR of the project. This is kind of annoying in this context 😕

Improvement to staging/production compose files

Hi @yajo ,

One thing I noticed is that running a command such as /opt/bin/docker-compose run --rm odoo psql where traefik labels are configured causes the web interface to become inaccessible (v12.0/pg11.1).

If you can reproduce, maybe something like this for the proxied compose configurations? which seems to work for me. Just removing the traefik labels. Not sure if this is a clean extendable way to do it. I just cut and paste and changed startup and labels.

    odoo_internal:
        extends:
            file: common.yaml
            service: odoo
        environment:
            <same as odoo environment stanza>
        restart: unless-stopped
        depends_on:
            - db
            - smtp
        networks:
            default:
            globalwhitelist_shared:
            inverseproxy_shared:
        command:
            - odoo
            - --workers=0

Windows Host (Docker for Windows) Support?

Apparently it's not possible to use Doodba (scaffolding) on ​​Windows ...

The command
export UID GID = "$ (id -g $ USER)" UMASK = "$ (umask)"
is logically not available on Windows.

With and without UID, GID and UMASK (had written the Windows User ID's as Env. In the ./.env File
I always get the following error message:

Traceback (most recent call last):
  File "/opt/odoo/common/build", line 32, in <module>
    subprocess.check_call(command)
  File "/usr/local/lib/python3.5/subprocess.py", line 266, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/local/lib/python3.5/subprocess.py", line 247, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/lib/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.5/subprocess.py", line 1289, in _execute_child
    raise child_exception_type(errno_num, err_msg)
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

Is there a way to run Doodba on Windows (or is support planned?)

Would not like to use a VM with Linux for our development environment because this undermines the sense of Docker ^^

greetings
Cloud500

(Translated with Google)

Let's encrypt

I'm having problem in obtaining Let's encrypt SSL certificate. I follow the instruction here but still SSL certificate shows Traefik Default Certificate.

Would you kindly point me to part of the configuration that i have to adjust or any documentation so i can solve this issue.

Many thanks.

Init VSCODE workspace after cloning doodba-scaffolding

Hello,

I see some VSCODE integration in this repo, but did not find how to initiate VSCODE workspace when just cloning doodba-scaffolding repo.

Can you just write stage i need to initiate it ?

Note: I try to execute .vscode/doodbasetup.py but hang with this traceback:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 814, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./doodbasetup.py", line 57, in
path.join(DEST, path.basename(config)),
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)>

My System: MACOS

Will try on linux and windows then :)

Thanks,

UTF-8 sorting not working correctly with used postgres image

I'm not sure how we should treat this. I think i should at least be a known issue. Maybe we should switch the used postgres image.

When using the default doodba postgres alpine image, sorting does not correctly work for UTF-8.

bigbear3001@wt-io-it-bigbear3001:~$ docker run --rm --name=pg_test_alpine -d postgres:10-alpine
0edf0f7ee9b25c051fb028c13d73fd6d5d4822d81afc88ce54d2f0d0230a3c42
bigbear3001@wt-io-it-bigbear3001:~$ docker exec pg_test_alpine psql -U postgres -c "SELECT unnest(array['a','ä','b']) ORDER BY 1"
 unnest 
--------
 a
 b
 ä
(3 rows)

bigbear3001@wt-io-it-bigbear3001:~$ docker stop pg_test_alpine
pg_test_alpine

vs the non alpine image

bigbear3001@wt-io-it-bigbear3001:~$ docker run --rm --name=pg_test -d postgres:10
0144a66be1c49ebf23612f287bbebeeadf6318566e530d695194237853c644a3
bigbear3001@wt-io-it-bigbear3001:~$ docker exec pg_test psql -U postgres -c "SELECT unnest(array['a','ä','b']) ORDER BY 1"
 unnest 
--------
 a
 ä
 b
(3 rows)

bigbear3001@wt-io-it-bigbear3001:~$ docker stop pg_test
pg_test

Only in the non alpine version the sorting of characters is working with what i think is called icu.

Should we switch to the non alpine version as default?

Test code is from PostgresApp/PostgresApp#216 (comment)

devel DB credentials

I'm not sure if this is the thread but here we go... I've installed the scaffolding, but I have no clue where to find the credentials to access de devel database autogenerated and the system fails to create a new DB.

I presume is a very silly question but I couldn't find the credentials anywhere in the code, nor the documentation and the DB image used!

Could anyone help me with this? is there a Google channel or similar to ask this kind of questions?

Thank you.

Test mails goes to wrong mailhog container

When running multiple test stacks (test.yaml) on different projects on the same docker host mails sent from the different odoo instances all end up in the mailhog container on the first started project.

This is because all the smtp containers is attached to the inverseproxy_shared network, and I guess the first one wins the hostname? And we need this network for the Traefik access to /smtpfake/, right?

A simple solution is of cause to rename the smtp contianer in the various projects to something unique - Or is there a more elegant solution ?

Unable to download from private repository on devel stage

On addons.yaml I create an entry for a private repository.

./eficent-website:
    defaults:
        depth: $DEPTH_DEFAULT
    remotes:
        Eficent: git+ssh://[email protected]/Eficent/eficent-website.git
    target:
        Eficent $ODOO_VERSION
    merges:
        - Eficent $ODOO_VERSION

When docker-compose -f setup-devel.yaml run --rm odoo is running on background is asking to generate an ssh key for /root/.ssh/id_rsa

What am I doing wrong?

I have an ssh key for pull it.

Error clonar dependecias en archivo pip.txt

Al ejecutar el comando docker-compose build --pull
me marca un error al clonar lo siguiente
Collecting` git+https://github.com/OCA/openupgradelib.git@master (from -r /opt/odoo/custom/dependencies/pip.txt (line 1))
revisando el archivo pip txt
veo que tiene dos palabras:

unicodecsv y unidecode

pip.txt

git+https://github.com/OCA/openupgradelib.git@master
unicodecsv
unidecode

como no se que hacen se las quite al archivo y corri de nuevo el comando y se ejecuto correctamente.

Estoy trabajando en windos 10 con el wsl en ubuntu.

Saludos

Doesn't work for Odoo 13 w/o setting additional ENV variable

Changing the major version (in the .env) to Odoo13 to deploy an Odoo13 instance currently results into the following error

(INFO) [13:20:01] git_aggregator.repo  odoo   Start aggregation of /opt/odoo/custom/src/odoo
(INFO) [13:20:01] git_aggregator.repo  odoo   Switch to branch saas-12.5
Reset branch 'saas-12.5'
(INFO) [13:20:03] git_aggregator.repo  odoo   Remote already exists ocb <https://github.com/OCA/OCB.git>
(INFO) [13:20:03] git_aggregator.repo  odoo   Remote already exists odoo <https://github.com/odoo/odoo.git>
(INFO) [13:20:03] git_aggregator.repo  odoo   Remote already exists openupgrade <https://github.com/OCA/OpenUpgrade.git>
(INFO) [13:20:03] git_aggregator.repo  odoo   Fetching required remotes
fatal: Couldn't find remote ref saas-12.5
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/git_aggregator/main.py", line 204, in aggregate_repo
    repo.aggregate()
  File "/usr/local/lib/python3.7/site-packages/git_aggregator/repo.py", line 179, in aggregate
    self.fetch()
  File "/usr/local/lib/python3.7/site-packages/git_aggregator/repo.py", line 202, in fetch
    self.log_call(cmd, cwd=self.cwd)
  File "/usr/local/lib/python3.7/site-packages/git_aggregator/repo.py", line 159, in log_call
    ret = callwith(cmd, **kw)
  File "/usr/local/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('git', 'fetch', '--depth', '100', 'ocb', 'saas-12.5')' returned non-zero exit status 128.
Traceback (most recent call last):
  File "/usr/local/bin/autoaggregate", line 127, in <module>
    aggregate(REPOS_YAML)
  File "/usr/local/bin/autoaggregate", line 46, in aggregate
    stdout=sys.stdout,
  File "/usr/local/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['gitaggregate', '--expand-env', '--config', '/opt/odoo/custom/src/repos.yaml', '--log-level', 'INFO', '--jobs', '4']' returned non-zero exit status 1.

on docker-compose -f setup-devel.yaml run --rm odoo
it seems that the variables are not correctly passed in the build context. Adding the last line to
ODOO_VERSION: $ODOO_MINOR to setup-devel.yaml seems to fix that.

environment:
            DEPTH_DEFAULT: 100
            # XXX Export these variables before running setup to own the files
            UID: "${UID:-1000}"
            GID: "${GID:-1000}"
            UMASK: "$UMASK"
            ODOO_VERSION: $ODOO_MINOR

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.