Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallels/Arm tweaks #941

Merged
merged 8 commits into from
Feb 6, 2022
Merged

Parallels/Arm tweaks #941

merged 8 commits into from
Feb 6, 2022

Conversation

tomjn
Copy link
Contributor

@tomjn tomjn commented Dec 26, 2021

Fixes some issues on M1 Macs and Parallels

Copy link
Member

@BronsonQuick BronsonQuick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for making a start on this! Most appreciated. I've left a few comments to follow up on as I think we might be able to simplify it 🤞🏻

Vagrantfile Outdated Show resolved Hide resolved
Vagrantfile Show resolved Hide resolved
Vagrantfile Show resolved Hide resolved
@tomjn
Copy link
Contributor Author

tomjn commented Dec 26, 2021 via email

@tomjn
Copy link
Contributor Author

tomjn commented Dec 26, 2021

current result of this PR on Parallels/Arm64:

==> default: Checking if box 'mpasternak/focal64-arm' version '202110.0.0' is up to date...
==> default: Running provisioner: shell...
    default: Running: /var/folders/dw/wdtnsdn154db04ymxv90t9tm0000gn/T/vagrant-shell20211226-64180-1554jem.sh
==> default: Running provisioner: shell...
    default: Running: inline script
    default: Warning: ModuleLoader: module 'elasticsearch' has unresolved dependencies - it will only see those that are resolved. Use 'puppet module list --tree' to see information about modules\n   (file & line not available)
    default: Error: Could not find resource 'Exec[systemctl-daemon-reload]' in parameter 'notify' (file: /vagrant/extensions/cavalcade/modules/cavalcade/manifests/init.pp, line: 47) on node siemens.local
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

@tomjn
Copy link
Contributor Author

tomjn commented Dec 26, 2021

That's running on Puppet 5

$ puppet --version
5.5.10

@BronsonQuick
Copy link
Member

Ahh right. I'm wonder if the submodules update I merged in from you in ES caused that. Can you please try changing the ES extension to be a commit before the submodule update and see if that works? If that's the case then I'll need to revert that.

I'll try a fresh provision of Chassis just with the ES extension now as well.

@tomjn
Copy link
Contributor Author

tomjn commented Dec 26, 2021

Can you please try changing the ES extension to be a commit before the submodule update and see if that works?

Nope because then it'll fail complaining Ubuntu 20 isn't supported in the Java puppet config

@BronsonQuick
Copy link
Member

No worries. I just did a fresh provision with ES and didn't have any issues so that's all good as you mentioned.

I did notice:

default: Error: Could not find resource 'Exec[systemctl-daemon-reload]' in parameter 'notify' (file: /vagrant/extensions/cavalcade/modules/cavalcade/manifests/init.pp, line: 47) on node siemens.local

I didn't realise Cavalcade was using that Exec function so I'll open a new issue for adding that back and I'll fix that now.

@tomjn
Copy link
Contributor Author

tomjn commented Dec 26, 2021

@BronsonQuick that helped, it progresses to this point now:

ontent as '{md5}b80e6a642bdcca742ed1c4f28e6861d3'
    default: Notice: /Stage[main]/Chassis::Php/Package[php7.4-curl]/ensure: created
    default: Notice: /Stage[main]/Chassis::Php/Package[php7.4-gd]/ensure: created
    default: Notice: /Stage[main]/Chassis::Php/Package[php7.4-mysql]/ensure: created
    default: Notice: /Stage[main]/Chassis/Package[nginx]/ensure: created
    default: Notice: /Stage[main]/Chassis/Package[sendmail]/ensure: created
    default: Notice: /Stage[main]/Chassis/Exec[systemctl-daemon-reload]: Triggered 'refresh' from 1 event
    default: Notice: /Stage[main]/Chassis/Exec[restart-avahi]/returns: executed successfully
    default: Notice: /Stage[main]/Chassis_openssl/File[/etc/nginx/sites-available/siemens.local.d]/ensure: created
    default: Notice: /Stage[main]/Chassis_openssl/File[/etc/nginx/sites-available/siemens.local.d/ssl]/ensure: defined content as '{md5}d43aa1e332fe578d2be4a6a95237f5c9'
    default: Notice: /Stage[main]/Chassis/File[/etc/nginx/nginx.conf]/content: content changed '{md5}d419ab8777e5d98481e17896e260dfe6' to '{md5}8e234d2d02906f318676d26b75f49c42'
    default: Notice: /Stage[main]/Chassis::Hosts/Service[chassis-hosts]/ensure: ensure changed 'stopped' to 'running'
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/File[/vagrant/index.php]/ensure: defined content as '{md5}60744b085e3f687928a2eb1177e62b42'
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/File[/vagrant/local-config-db.php]/ensure: defined content as '{md5}2ad40bdacccd17abd68b16f7bb5a041e'
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/File[/vagrant/local-config-extensions.php]/ensure: defined content as '{md5}9881805b872b4ef952b6ff9db3098457'
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/File[/home/vagrant/.wp-cli]/ensure: created
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/File[/home/vagrant/.wp-cli/config.yml]/ensure: defined content as '{md5}beac827deb496c6edf1f38124a029ac2'
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/File[/vagrant/wp-cli.yml]/ensure: defined content as '{md5}ee75a80af6dcfe7712a0477afc35f690'
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/File[/chassis/wordpress]/ensure: created
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/File[/etc/nginx/sites-available/siemens.local]/ensure: defined content as '{md5}3e59756e96b77e188aacfabcf689bb59'
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/File[/etc/nginx/sites-enabled/siemens.local]/ensure: created
    default: Notice: /Stage[main]/Chassis/Service[nginx]: Triggered 'refresh' from 4 events
    default: Notice: /Stage[main]/Main/File[/var/www/html/index.html]/ensure: defined content as '{md5}364abbbe228cf1a9f6beea99ce4f8e45'
    default: Notice: /Stage[main]/Mysql::Client::Install/Package[mysql_client]/ensure: created
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/Mysql::Db[wordpress]/Mysql_database[wordpress]/ensure: created
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/Mysql::Db[wordpress]/Mysql_user[wordpress@localhost]/ensure: created
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/Mysql::Db[wordpress]/Mysql_grant[wordpress@localhost/wordpress.*]/ensure: created
    default: Notice: /Stage[main]/Wp::Cli/File[/usr/local/src/wp-cli]/ensure: created
    default: Notice: /Stage[main]/Wp::Cli/File[/usr/local/src/wp-cli/bin]/ensure: created
    default: Notice: /Stage[main]/Wp::Cli/Exec[wp-cli download]/returns: executed successfully
    default: Notice: /Stage[main]/Wp::Cli/File[/usr/local/src/wp-cli/bin/wp]/mode: mode changed '0644' to '0755' (a+x)
    default: Notice: /Stage[main]/Wp::Cli/File[/usr/bin/wp]/ensure: created
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/Wp::Site[/chassis/wordpress]/Exec[wp install /chassis/wordpress]/returns: Error: This does not seem to be a WordPress installation.
    default: Notice: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/Wp::Site[/chassis/wordpress]/Exec[wp install /chassis/wordpress]/returns: Pass --path=`path/to/wordpress` or run `wp core download`.
    default: Error: '/usr/bin/wp core install --url='http://siemens.local/' --title='Chassis Site' --admin_email='admin@example.com' --admin_name='admin' --admin_password='password'' returned 1 instead of one of [0]
    default: Error: /Stage[main]/Main/Chassis::Wp[siemens.local]/Chassis::Site[siemens.local]/Wp::Site[/chassis/wordpress]/Exec[wp install /chassis/wordpress]/returns: change from 'notrun' to ['0'] failed: '/usr/bin/wp core install --url='http://siemens.local/' --title='Chassis Site' --admin_email='admin@example.com' --admin_name='admin' --admin_password='password'' returned 1 instead of one of [0]
    default: Notice: Applied catalog in 278.96 seconds
==> default: Running provisioner: shell...
    default: Running: /var/folders/dw/wdtnsdn154db04ymxv90t9tm0000gn/T/vagrant-shell20211226-67398-bte9e2.sh
==> default: Running provisioner: set_constants (shell)...
    default: Running: /var/folders/dw/wdtnsdn154db04ymxv90t9tm0000gn/T/vagrant-shell20211226-67398-9f8a9t.sh
==> default: Running action triggers after up ...
==> default: Running trigger...

chassis on  arm-tweaks via 🐘 v8.1.1 via ⍱ v2.2.19 took 4m53s 
❯ 

@tomjn
Copy link
Contributor Author

tomjn commented Dec 26, 2021

this is my test config btw:

paths:
    base: ..
    content: content
    wp: wordpress

hosts:
    - siemens.local

_mode: base

# Define database prefix, since we have tests as well
database:
    name: wordpress
    user: wordpress
    password: vagrantpassword
    prefix: wp_

# Define the extensions we want
extensions:
    - chassis/xdebug
    - chassis/tester
    - chassis/sequelpro
    - chassis/cavalcade
    - chassis/mailhog
    - chassis/memcache
    - chassis/phpcs
    - chassis/chassis_openssl
    - chassis/redis
    - chassis/chassis_elasticsearch
    - chassis/runkit7

elasticsearch:
  repo_version: '7.x'
  version: '7.9.3'
  host: '0.0.0.0'
  port: 9200
  timeout: 10
  instances:
    - 'es'
  jvm_options:
    - '-Xms256m'
    - '-Xmx256m'

@BronsonQuick
Copy link
Member

BronsonQuick commented Dec 26, 2021

@tomjn That's getting super close! 🕺 One thing to confirm, is your config file in the root directory? Because paths only work if the config is in the root directory.

@tomjn
Copy link
Contributor Author

tomjn commented Dec 27, 2021

@BronsonQuick that did the trick, I did another vagrant up after some direnv trickery and http://siemens.local served me the WP install screen

@BronsonQuick
Copy link
Member

@tomjn That's awesome news! Nice work Sir!

@kadamwhite
Copy link
Contributor

kadamwhite commented Jan 3, 2022

I pulled this to test locally on a fresh M1 system, and I'm stalling out due to an unavailable box:

Bringing machine 'default' up with 'parallels' provider...
==> default: Running action triggers before up ...
==> default: Running trigger...
==> default: Box 'chassis/chassis' could not be found. Attempting to find and install...
    default: Box Provider: parallels
    default: Box Version: >= 4.0, < 5.0
==> default: Loading metadata for box 'chassis/chassis'
    default: URL: https://vagrantcloud.com/chassis/chassis
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.

Name: chassis/chassis
Address: https://vagrantcloud.com/chassis/chassis
Requested provider: [:parallels]
kadam@Ks-MacBook-Pro chassis % git status
On branch arm-tweaks
Your branch is up to date with 'tomjn/arm-tweaks'.

nothing to commit, working tree clean

This was with a fresh checkout of chassis/chassis and no custom config.

Copy link
Contributor

@kadamwhite kadamwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Tom instructed me to try base box mode (which I hadn't known about, thanks!) and with this config.local.yaml

# config.local.yaml

_mode: base

I was able to get to the WP login screen successfully 👍 🚀 ✅ And it runs fast!

I'll defer to @BronsonQuick but this is working for me, thanks for taking this on @tomjn

@@ -38,7 +38,6 @@ if [[ ! -f /etc/chassis-updated ]]; then
# Update apt
sudo apt-get update

# Install/Upgrade Puppet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I am a stupidhead 😂 I probably just missed it when I was adding it back when Puppet v7 didn't play nicely!

Vagrantfile Outdated Show resolved Hide resolved
Co-authored-by: K Adam White <kadamwhite@users.noreply.github.com>
@tomjn
Copy link
Contributor Author

tomjn commented Jan 31, 2022

I'm struggling to find the bandwidth to write docs for this, the general gist is:

  • set the mode to basebox
  • install Parallels Pro/Business
  • install vagrant-parallels plugin
  • vagrant up as usual

Where that goes and how descriptive it needs to be to fit into the Chassis docs? ¯\_(ツ)_/¯

@tomjn
Copy link
Contributor Author

tomjn commented Jan 31, 2022

As I understand it, the docs needing to be written are the blocker for this, I'm more than happy for someone to pick that up, I am not a blocker for this

@BronsonQuick
Copy link
Member

Hey @tomjn, the docs go in the docs folder. Thanks for the notes. I'll pick this up in the next couple of days and add the docs. Thanks again for the PR and troubleshooting. Most appreciated!

@BronsonQuick BronsonQuick self-assigned this Feb 1, 2022
@BronsonQuick
Copy link
Member

I've added a separate issue for me to do the docs: #953 I'll merge this in and type up some docs now. Thanks again @tomjn and @kadamwhite 🙌🏻

@tomjn
Copy link
Contributor Author

tomjn commented Feb 6, 2022

@BronsonQuick did you mean to merge this PR? I'm not seeing equivalent commits merged elsewhere

@BronsonQuick BronsonQuick reopened this Feb 6, 2022
@BronsonQuick
Copy link
Member

@tomjn I did hit merge this morning and it looks like it didn't go through. I had two other PRs timing out on their checks too so I'm guessing something was up with Github. Thanks for the heads up! Let me try that again!

@BronsonQuick BronsonQuick dismissed their stale review February 6, 2022 04:21

I've added the docs for this.

@BronsonQuick BronsonQuick merged commit 49a2c83 into Chassis:main Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants