I am new to the chef I could not understand what is an issue. Following is my default script
apt_update 'Update the apt cache daily' do
frequency 86_400
action :periodic
end
package 'apache2'
service 'apache2' do
supports status: true
action [:enable, :start]
end
template '/var/www/html/index.html' do
source 'index.html.erb'
end
this is the error I am getting
[2020-04-25T12:57:00+00:00] FATAL: Stacktrace dumped to /home/vagrant/.chef/local-mode-cache/cache/chef-stacktrace.out
[2020-04-25T12:57:00+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-04-25T12:57:00+00:00] FATAL: Chef::Exceptions::FileNotFound: template[/var/www/html/index.html] (learn_chef_apache2::default line 18) had an error: Chef::Exceptions::FileNotFound: Cookbook 'learn_chef_apache2' (0.1.0) does not contain a file at any of these locations:
templates/host-vagrant.vm/index.html.erb
templates/ubuntu-18.04/index.html.erb
templates/ubuntu/index.html.erb
templates/default/index.html.erb
templates/index.html.erb
and this is my cookbooks tree
cookbooks
├── learn_chef_apache2
│ ├── Berksfile
│ ├── CHANGELOG.md
│ ├── chefignore
│ ├── LICENSE
│ ├── metadata.rb
│ ├── README.md
│ ├── recipes
│ │ └── default.rb
│ ├── spec
│ │ ├── spec_helper.rb
│ │ └── unit
│ │ └── recipes
│ │ └── default_spec.rb
│ └── test
│ └── integration
│ └── default
│ └── default_test.rb
├── learn_chef_appache2
│ └── templates
│ ├── default
│ └── index.html.erb
└── templates
└── index.html.erb
Can someone please help me what wrong I am doing and it will be great if you can share a link or explain it for my understanding.
what I did wrong was my template was created outside learn_chef_apache2 whereas it should be inside as follwing
cookbooks
└── learn_chef_apache2
├── Berksfile
├── CHANGELOG.md
├── chefignore
├── index.html.erb
├── LICENSE
├── metadata.rb
├── README.md
├── recipes
│ └── default.rb
├── spec
│ ├── spec_helper.rb
│ └── unit
│ └── recipes
│ └── default_spec.rb
├── templates
│ └── index.html.erb
└── test
└── integration
└── default
└── default_test.rb
Related
Tree level overview of my project:
├── build
│ ├── build.ninja
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ │ ├── 3.18.0-rc1
│ │ ├── cmake.check_cache
│ │ ├── CMakeError.log
│ │ ├── CMakeOutput.log
│ │ ├── CMakeTmp
│ │ ├── cmake.verify_globs
│ │ ├── hftbot.dir
│ │ ├── Makefile2
│ │ ├── progress.marks
│ │ ├── rules.ninja
│ │ ├── TargetDirectories.txt
│ │ └── VerifyGlobs.cmake
│ ├── cmake_install.cmake
│ ├── compile_commands.json
│ ├── details.json
│ ├── external
│ │ └── json
│ ├── hftbot
│ ├── Makefile
│ └── src
│ ├── CMakeFiles
│ ├── cmake_install.cmake
│ └── Makefile
├── build.sh
├── CMakeLists.txt
├── configure.sh
├── details.json
├── external
│ ├── asio
│ │ ├── CMakeLists.txt
│ │ ├── doc
│ │ ├── example
│ │ ├── include
│ │ ├── index.html
│ │ ├── meta
│ │ ├── test
│ │ └── tools
│ ├── CMakeLists.txt
│ └── json
│ ├── bench
│ ├── build
│ ├── CHANGELOG.md
│ ├── check
│ ├── cmake
│ ├── CMakeLists.txt
│ ├── CONTRIBUTING.md
│ ├── doc
│ ├── example
│ ├── fuzzing
│ ├── include
│ ├── index.html
│ ├── Jamfile
│ ├── LICENSE_1_0.txt
│ ├── meta
│ ├── README.md
│ ├── src
│ └── test
├── run.sh
└── src
├── CMakeLists.txt
├── httpClient.cpp
└── WebsocketClient.cpp
https://github.com/boostorg/json
i cloned this project to "external/json" directory from root directory.
I added following commands in CMakeLists.txt in the root directory
target_include_directories(${PROJECT_NAME} PUBLIC "external/json/include")
target_link_libraries(${PROJECT_NAME} PUBLIC boost_json)
And when i add this :
#include <boost/json.hpp>
#include <boost/json/src.hpp>
it says that source boost/json.hpp and boost/json/src.hpp is not found.
I know this has been asked a lot of times but none of the solutions seem to work. I am trying to run a Django app in Heroku but am running into issues when I try to scale dynos.
➜ main-website git:(master) heroku ps:scale web=1
Scaling dynos... !
▸ Couldn't find that process type (web).
The issue seems to be related to ProcFile. This is what I have configured in my root directory (same as requirements.txt etc).
web: gunicorn main-website.wsgi:application --log-file -
What am I missing or doing wrong so I can correct this?
Project Structure
➜ main-website git:(master) tree -L 3
.
├── app
│ ├── about
│ │ ├── admin.py
│ │ ├── apps.py
│ │ ├── __init__.py
│ │ ├── migrations
│ │ ├── models.py
│ │ ├── __pycache__
│ │ ├── tests.py
│ │ ├── urls.py
│ │ └── views.py
│ ├── app
│ │ ├── asgi.py
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ ├── settings.py
│ │ ├── urls.py
│ │ └── wsgi.py
│ ├── contact
│ │ ├── admin.py
│ │ ├── apps.py
│ │ ├── __init__.py
│ │ ├── migrations
│ │ ├── models.py
│ │ ├── __pycache__
│ │ ├── tests.py
│ │ ├── urls.py
│ │ └── views.py
│ ├── core
│ │ ├── admin.py
│ │ ├── apps.py
│ │ ├── __init__.py
│ │ ├── migrations
│ │ ├── models.py
│ │ ├── __pycache__
│ │ ├── tests
│ │ ├── tests.py
│ │ └── views.py
│ ├── db.sqlite3
│ ├── home
│ │ ├── admin.py
│ │ ├── apps.py
│ │ ├── __init__.py
│ │ ├── migrations
│ │ ├── models.py
│ │ ├── __pycache__
│ │ ├── static
│ │ ├── tests.py
│ │ ├── urls.py
│ │ └── views.py
│ ├── manage.py
│ ├── privacy
│ │ ├── admin.py
│ │ ├── apps.py
│ │ ├── __init__.py
│ │ ├── migrations
│ │ ├── models.py
│ │ ├── __pycache__
│ │ ├── tests.py
│ │ ├── urls.py
│ │ └── views.py
│ ├── static
│ │ ├── app
│ │ ├── css
│ │ ├── images
│ │ └── scripts
│ └── templates
│ ├── about.html
│ ├── contact.html
│ ├── footer.html
│ ├── header.html
│ ├── home.html
│ ├── layout.html
│ ├── privacy.html
│ └── slider.html
├── docker-compose.yml
├── Dockerfile
├── LICENSE
├── ProcFile
└── requirements.txt
The file name is Procfile not ProcFile.
Then try this web: gunicorn main-website.wsgi:application --log-file -
I developed locally using Docker and cookiecutter-django.
Cookiecutter-django creates several Dockerfiles within the "compose" directory.
I am now trying to push the project to Heroku.
However, heroku container:push web will return No images to push.
If I try the same command within a subdirectory of the compose directory, it will eventually break--probably due to an attempt at only pushing partial dockerfiles.
How do I get this up and running on Heroku taking advantage of Heroku containers?
This article from Heroku says I can push multiple images using by renaming the Dockerfiles, but I'm not sure how to figure out which of these cookiecutter-generated Dockerfiles are of which process type.
docker images will return:
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 16e570f295a7 10 minutes ago 318MB
luup_celeryworker latest bd7ff7e5eb10 2 hours ago 531MB
luup_django latest bd7ff7e5eb10 2 hours ago 531MB
luup_celerybeat latest bd7ff7e5eb10 2 hours ago 531MB
luup_postgres latest e50eb7b8a704 2 hours ago 287MB
registry.heroku.com/fierce-forest-57627/web latest 27690b3e49d4 16 hours ago 766MB
python 3.6-alpine c3a4a35c9244 22 hours ago 90MB
This is the Dockerfile made by cookiecutter. It is the DF under compose/production/django. There are other DFs--for caddy, postgres, as well as DFs for local.
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1
RUN apk update \
# psycopg2 dependencies
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
# Pillow dependencies
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
# CFFI dependencies
&& apk add libffi-dev openssl-dev py-cffi
RUN addgroup -S django \
&& adduser -S -G django django
# Requirements have to be pulled and installed here, otherwise caching won't work
COPY ./requirements /requirements
RUN pip install --no-cache-dir -r /requirements/production.txt \
&& rm -rf /requirements
COPY ./compose/production/django/gunicorn.sh /gunicorn.sh
RUN sed -i 's/\r//' /gunicorn.sh
RUN chmod +x /gunicorn.sh
RUN chown django /gunicorn.sh
COPY ./compose/production/django/entrypoint.sh /entrypoint.sh
RUN sed -i 's/\r//' /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chown django /entrypoint.sh
COPY ./compose/production/django/celery/worker/start.sh /start-celeryworker.sh
RUN sed -i 's/\r//' /start-celeryworker.sh
RUN chmod +x /start-celeryworker.sh
COPY ./compose/production/django/celery/beat/start.sh /start-celerybeat.sh
RUN sed -i 's/\r//' /start-celerybeat.sh
RUN chmod +x /start-celerybeat.sh
COPY . /app
RUN chown -R django /app
USER django
WORKDIR /app
ENTRYPOINT ["/entrypoint.sh"]
Please let me know if you need any more information
Edit--adding tree:
note: I've renamed the Dockerfiles to Dockerfile.processtype as instructed by Heroku here--Although I'm no longer pushing multiple images.. As you can tell in the tree, I've also moved a copy of Dockerfile.django and Dockerfile.local to the root of the project, as that's where it needs to be in order to Heroku container:push processtype --recursive.
├── Dockerfile.django
├── Dockerfile.local
├── LICENSE
├── Procfile
├── README.rst
├── compose
│ ├── local
│ │ └── django
│ │ ├── celery
│ │ │ ├── beat
│ │ │ │ └── start.sh
│ │ │ └── worker
│ │ │ └── start.sh
│ │ └── start.sh
│ └── production
│ ├── caddy
│ │ ├── Caddyfile
│ │ └── Dockerfile.caddy
│ ├── django
│ │ ├── Dockerfile.django
│ │ ├── celery
│ │ │ ├── beat
│ │ │ │ └── start.sh
│ │ │ └── worker
│ │ │ └── start.sh
│ │ ├── entrypoint.sh
│ │ └── gunicorn.sh
│ └── postgres
│ ├── Dockerfile.postgres
│ └── maintenance
│ ├── _sourced
│ │ ├── constants.sh
│ │ ├── countdown.sh
│ │ ├── messages.sh
│ │ └── yes_no.sh
│ ├── backup
│ ├── backups
│ └── restore
├── config
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-35.pyc
│ │ ├── __init__.cpython-36.pyc
│ │ ├── urls.cpython-36.pyc
│ │ └── wsgi.cpython-36.pyc
│ ├── settings
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-35.pyc
│ │ │ ├── __init__.cpython-36.pyc
│ │ │ ├── base.cpython-35.pyc
│ │ │ ├── base.cpython-36.pyc
│ │ │ ├── local.cpython-35.pyc
│ │ │ ├── local.cpython-36.pyc
│ │ │ └── production.cpython-36.pyc
│ │ ├── base.py
│ │ ├── local.py
│ │ ├── production.py
│ │ └── test.py
│ ├── urls.py
│ └── wsgi.py
├── docs
│ ├── Makefile
│ ├── __init__.py
│ ├── conf.py
│ ├── deploy.rst
│ ├── docker_ec2.rst
│ ├── index.rst
│ ├── install.rst
│ └── make.bat
├── heroku.yml
├── local.yml
├── locale
│ └── README.rst
├── lurnup
│ ├── __init__.py
│ ├── __pycache__
│ │ └── __init__.cpython-36.pyc
│ ├── contrib
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ └── __init__.cpython-36.pyc
│ │ └── sites
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ └── __init__.cpython-36.pyc
│ │ └── migrations
│ │ ├── 0001_initial.py
│ │ ├── 0002_alter_domain_unique.py
│ │ ├── 0003_set_site_domain_and_name.py
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ ├── 0001_initial.cpython-36.pyc
│ │ ├── 0002_alter_domain_unique.cpython-36.pyc
│ │ ├── 0003_set_site_domain_and_name.cpython-36.pyc
│ │ └── __init__.cpython-36.pyc
│ ├── static
│ │ ├── css
│ │ │ └── project.css
│ │ ├── fonts
│ │ ├── images
│ │ │ └── favicon.ico
│ │ ├── js
│ │ │ └── project.js
│ │ └── sass
│ │ ├── custom_bootstrap_vars.scss
│ │ └── project.scss
│ ├── taskapp
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-36.pyc
│ │ │ └── celery.cpython-36.pyc
│ │ └── celery.py
│ ├── templates
│ │ ├── 403_csrf.html
│ │ ├── 404.html
│ │ ├── 500.html
│ │ ├── account
│ │ │ ├── account_inactive.html
│ │ │ ├── base.html
│ │ │ ├── email.html
│ │ │ ├── email_confirm.html
│ │ │ ├── login.html
│ │ │ ├── logout.html
│ │ │ ├── password_change.html
│ │ │ ├── password_reset.html
│ │ │ ├── password_reset_done.html
│ │ │ ├── password_reset_from_key.html
│ │ │ ├── password_reset_from_key_done.html
│ │ │ ├── password_set.html
│ │ │ ├── signup.html
│ │ │ ├── signup_closed.html
│ │ │ ├── verification_sent.html
│ │ │ └── verified_email_required.html
│ │ ├── base.html
│ │ ├── pages
│ │ │ ├── about.html
│ │ │ └── home.html
│ │ └── users
│ │ ├── user_detail.html
│ │ ├── user_form.html
│ │ └── user_list.html
│ └── users
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-36.pyc
│ │ ├── adapters.cpython-36.pyc
│ │ ├── admin.cpython-36.pyc
│ │ ├── apps.cpython-36.pyc
│ │ ├── models.cpython-36.pyc
│ │ ├── urls.cpython-36.pyc
│ │ └── views.cpython-36.pyc
│ ├── adapters.py
│ ├── admin.py
│ ├── apps.py
│ ├── migrations
│ │ ├── 0001_initial.py
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ ├── 0001_initial.cpython-36.pyc
│ │ └── __init__.cpython-36.pyc
│ ├── models.py
│ ├── tests
│ │ ├── __init__.py
│ │ ├── factories.py
│ │ ├── test_admin.py
│ │ ├── test_models.py
│ │ ├── test_urls.py
│ │ └── test_views.py
│ ├── urls.py
│ └── views.py
├── manage.py
├── merge_production_dotenvs_in_dotenv.py
├── production.yml
├── pytest.ini
├── requirements
│ ├── base.txt
│ ├── local.txt
│ └── production.txt
Cookiecutter-django provides a standard docker compose configuration that you can push on several hosting services with full Docker support.
However, Heroku supports Docker with a few restrictions. For instance, the port for the WSGI server is hardcoded to 5000, where Heroku requires to use the environment variable $PORT.
These are NOT accounted for in cookiecutter-django, so you will have to change a few things:
I'd start with the images in compose/production/django and ignore the DB (prvided via add-on) and Caddy (see here instead).
Change the Gunicorn port from 5000 to $PORT
The code to get DATABASE_URL in entrypoint.sh should probably not be needed.
Last but not least: create a heroku.yml file to point at the DF you want to use.
With docker-compose, you can re-use the same Dockerfile and change the entrypoint, but I don't think it's feasible with Heroku. You might need to create a duplicate the web Dockerfile and change it for your Celery dynos.
I've tried Docker on Heroku, but not with cookiecutter-django' setup. The Heroku way is not standard enough IMO, it's a bit of a middle ground between pure Heroku and bare Docker.
Hope that helps!
I'm building a custom opencart payment extension (ocmod installable), I need to use an external payment provider sdk (located in the vendor folder) but i don't know how include this files on my packaged extension
This is my folder structure
..
├── install.xml
└── upload
├── admin
├── catalog
├── composer.json
├── image
└── vendor
To develop a payment extention for opencart, follow this structure
admin
│ ├── controller
│ │ ├── payment
│ │ │ ├── custom_payment.php
language
│ │ └── en-GB
│ │ ├── payment
│ │ │ ├── custom_payment.php
template
├── payment
│ ├── custom_payment.tpl
catalog/
├── controller
│ ├── payment
│ │ ├── custom_payment.php
├── language
│ └── en-GB
│ ├── payment
│ │ ├── custom_payment.php
├── model
│ ├── payment
│ │ ├── custom_payment.php
└── view
└── theme
├── default / your_theme
│ └── template
├── payment
│ ├── custom_payment.tpl
Eclipse Neon (4.6.0).
PyDev for Eclipse 5.1.2.201606231256
I have created a Django project:
File / New / Project / PyDev Django project
Selected "Add project directory to the PYTHONPATH".
Now I have this folder structure.
(django_comments) michael#ThinkPad:~/workspace/formsets$ tree
.
└── formsets
├── db.sqlite3
├── formsets
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-35.pyc
│ │ ├── settings.cpython-35.pyc
│ │ ├── urls.cpython-35.pyc
│ │ └── wsgi.cpython-35.pyc
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── home_page
│ ├── admin.py
│ ├── apps.py
│ ├── __init__.py
│ ├── migrations
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ └── __init__.cpython-35.pyc
│ ├── models.py
│ ├── __pycache__
│ │ ├── admin.cpython-35.pyc
│ │ ├── __init__.cpython-35.pyc
│ │ ├── models.cpython-35.pyc
│ │ └── views.cpython-35.pyc
│ ├── templates
│ │ └── home_page
│ │ └── home_page.html
│ ├── tests.py
│ └── views.py
└── manage.py
In prjoect properties in PyDev-PYTHONPATH at the tab Source Folders I have:
/${PROJECT_DIR_NAME}
In home_page/views.py I have created HomePageView. And in urls.py I would like to import it:
from home_page.views import HomePageView
The problem is:
1) HomePageView is underlined with red line. Error is Unresolved import: HomePageView.
2) Code completion is not working.
By the way, if I run the project, it works. That HomePageView shows what was expected.
Could you help me understand what have I done wrongly.
Try to add a path to the directory where your manage.py file is located. So I'm guessing it to add:
/${PROJECT_DIR_NAME}/formsets