Run docker-compose with podman as a backend on MacOS - macos

I am trying to run docker-compose CLI with podman backend on my local machine (MacOS). Here is what I did:
Install podman using brew: brew install podman
Initialize the podman machine: podman machine init
Started the machine: podman machine start
Running podman version gives me this:
Client:
Version: 3.4.4
API Version: 3.4.4
Go Version: go1.17.6
Built: Wed Dec 8 19:41:11 2021
OS/Arch: darwin/amd64
Server:
Version: 3.4.4
API Version: 3.4.4
Go Version: go1.16.8
Built: Wed Dec 8 22:45:07 2021
OS/Arch: linux/amd64
I created a symlink for podman (ln -s podman docker), so running docker version gives me the same and I can actually run containers using docker run even though docker is not installed.
Afterwards I installed docker-compose using:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version gives me this:
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.9.0
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
Problem is that docker-compose up test is not working as docker-compose doesn't seem to find the docker host to connect to or is somehow blocked, does somebody know how to solve this issue:
Traceback (most recent call last):
File "urllib3/connectionpool.py", line 670, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1255, in request
File "http/client.py", line 1301, in _send_request
File "http/client.py", line 1250, in endheaders
File "http/client.py", line 1010, in _send_output
File "http/client.py", line 950, in send
File "docker/transport/unixconn.py", line 43, in connect
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "requests/adapters.py", line 439, in send
File "urllib3/connectionpool.py", line 726, in urlopen
File "urllib3/util/retry.py", line 410, in increment
File "urllib3/packages/six.py", line 734, in reraise
File "urllib3/connectionpool.py", line 670, in urlopen
File "urllib3/connectionpool.py", line 392, in _make_request
File "http/client.py", line 1255, in request
File "http/client.py", line 1301, in _send_request
File "http/client.py", line 1250, in endheaders
File "http/client.py", line 1010, in _send_output
File "http/client.py", line 950, in send
File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker/api/client.py", line 214, in _retrieve_server_version
File "docker/api/daemon.py", line 181, in version
File "docker/utils/decorators.py", line 46, in inner
File "docker/api/client.py", line 237, in _get
File "requests/sessions.py", line 543, in get
File "requests/sessions.py", line 530, in request
File "requests/sessions.py", line 643, in send
File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 81, in main
File "compose/cli/main.py", line 200, in perform_command
File "compose/cli/command.py", line 60, in project_from_options
File "compose/cli/command.py", line 152, in get_project
File "compose/cli/docker_client.py", line 41, in get_client
File "compose/cli/docker_client.py", line 170, in docker_client
File "docker/api/client.py", line 197, in __init__
File "docker/api/client.py", line 221, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))
[63757] Failed to execute script docker-compose

Did you install podman-mac-helper?
sudo /opt/homebrew/Cellar/podman/4.0.2/bin/podman-mac-helper install
docker-compose v2.3.4 works just fine with Podman v4.0.2 on a MacBook Pro M1 running macOS Monterey as long as you install podman-mac-helper (which makes /var/run/docker.sock available.)

Related

VirtualBox anaconda installation failing

Having trouble installing anaconda on my Ubuntu VirtualBox. Have tried rebooting and have tried assigning a bigger chunk of base memory but still failing at the final few hurdles.
Unpacking payload ...
concurrent.futures.process._RemoteTraceback:
'''
Traceback (most recent call last):
File "concurrent/futures/process.py", line 368, in _queue_management_worker
File "multiprocessing/connection.py", line 251, in recv
TypeError: __init__() missing 1 required positional argument: 'msg'
'''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "entry_point.py", line 69, in <module>
File "concurrent/futures/process.py", line 484, in _chain_from_iterable_of_lists
File "concurrent/futures/_base.py", line 611, in result_iterator
File "concurrent/futures/_base.py", line 439, in result
File "concurrent/futures/_base.py", line 388, in __get_result
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or
pending.
[1981] Failed to execute script entry_point

"No module named error" when try to run Elasticalert

When I try to run elastalert
python -m elastalert.elastalert --verbose --start 2019-09-04 --rule rules/rule.yaml --config config.yaml
I get following error.
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/elastalert-0.2.1-py2.7.egg/elastalert/elastalert.py", line 29, in <module>
from . import kibana
File "/usr/local/lib/python2.7/dist-packages/elastalert-0.2.1-py2.7.egg/elastalert/kibana.py", line 4, in <module>
import urllib.error
ImportError: No module named error
My environment is
ubuntu 18
elasticsearch 6.3.0

Cannot connect to localhost when running Django

I am trying to run my Django project and I encountered the following problem:
^C(venv) tests-MacBook-Pro-2:hearinsights morganlai$ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x103fc46e0>
Traceback (most recent call last):
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
self.check_migrations()
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 163, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
self.loader = MigrationLoader(self.connection)
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 49, in __init__
self.build_graph()
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 176, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
self.ensure_schema()
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 231, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 204, in _cursor
self.ensure_connection()
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
self.connect()
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 171, in connect
self.connection = self.get_new_connection(conn_params)
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/django/db/backends/postgresql/base.py", line 175, in get_new_connection
connection = Database.connect(**conn_params)
File "/Users/morganlai/Desktop/hearinsights-heap/venv/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
I have tried to start and restart the postgres database following the instructions here: How to start PostgreSQL server on Mac OS X?
After restart the server, the problem still occured:
tests-MacBook-Pro-2:hearinsights morganlai$ pg_ctl -D /usr/local/var/postgres stop -s -m fast
pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist
Is server running?
tests-MacBook-Pro-2:hearinsights morganlai$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
I would encounter this problem every single time when I restarted my mac and the solution provided by that article usually worked in the past. Since it is not working this time, I wonder it might be some other problems.
Try to uninstall the current postgres files. And install it from scratch using homebrew:
https://launchschool.com/blog/how-to-install-postgresql-on-a-mac
This might fix your issue.

Deploy Laravel on Cloud Foundry

I`m trying to deploy Laravel on Cloud Foundry, but at the end, it failed.
I followed this tutorial step by step. Also, I tried to solve my problem by this question but it doesn't work for me. And the overall view of my app is looks like this
However this is the errors, when I push the app to cf:
WARNING: A version of PHP has been specified in both `composer.json` and `./bp-config/options.json`.
WARNING: The version defined in `composer.json` will be used.
The extension 'fpm' is not provided by this buildpack.
The extension 'tokenizer' is not provided by this buildpack.
[ErrorException]
file_put_contents(/tmp/app/htdocs/bootstrap/cache/services.json): failed to open stream: No such file or directory
-----> Composer command failed
Traceback (most recent call last):
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/scripts/compile.py", line 50, in <module>
.from_build_pack('lib/additional_commands')
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/lib/build_pack_utils/builder.py", line 208, in extensions
process_extension(path, ctx, 'compile', process, args=[self])
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/lib/build_pack_utils/utils.py", line 69, in process_extension
success(getattr(extn, to_call)(*args))
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/extensions/composer/extension.py", line 414, in compile
return composer.compile(install)
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/lib/extension_helpers.py", line 154, in compile
self._compile(install)
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/extensions/composer/extension.py", line 181, in _compile
self.run()
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/extensions/composer/extension.py", line 316, in run
*self._ctx['COMPOSER_INSTALL_OPTIONS'])
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/extensions/composer/extension.py", line 360, in run
shell=True)
File "/tmp/buildpacks/ca44b1cd9a98d10d3246e577384a9145/lib/build_pack_utils/runner.py", line 109, in stream_output
raise CalledProcessError(retcode, cmd)
build_pack_utils.runner.CalledProcessError: Command '<open file '<fdopen>', mode 'w' at 0x7fa7340816f0>' returned non-zero exit status 1
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
I need your help to solve this issue!

Ambari error during installation yarn

i'm trying to install IBM Open Platform 4.1 on Linux RedHat6; i created local repository for IOP and IOP-UTILS, because of proxy that block connection to ibm.
I installed ambari correctly but during installation of all packages i get this error:
1
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 70, in inner
result = function(command, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 92, in checked_call
tries=tries, try_sleep=try_sleep)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 140, in _call_wrapper
result = _call(command, **kwargs_copy)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 291, in _call
raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of '/usr/bin/yum -d 0 -e 0 -y install 'hadoop_4_1_*-yarn'' returned 1.
Error: Nothing to do

Resources