Xcode Server Integration Cache Location, Ram Disk, and _xcsbuildd - xcode

I'm working with Xcode Server and continuous integrations. We're experiencing really slow build times.
My first attempt at speed up is using a RAM DISK and storing build files there. We are using mac mini with a SATA drive so I'm attempting to see how much time could be saved by eliminating that drive from part of the build process.
I created a RAM DISK with:
diskutil erasevolume HFS+ 'XcodeData' `hdiutil attach -nomount ram://8388608
I started by trying to set the DerivedData location onto the ram disk, but when running a CI build data isn't stored there.
I found what looks to be the build data for every CI at /Library/Developer/Integrations/Caches.
I tried symlinking ln -s /XcodeData/IntegrationCaches/ /Library/Developer/Integrations/Caches but I get permission errors when running the CI.
I tried chmod 777 /XcodeData/IntegrationCaches/ and I still get permission issues.
I also tried to chown my ramdisk folder to chown _xcsbuildd IntegrationsCaches for ram disk folder.
Haven't had any luck so far.
Has anyone else tried doing something like this?

Like #bolnad mentioned in the comments, it turned out that the RAM DISK by default ignores ownership. You can "Get Info" in the finder for that volume, then uncheck "Ignore Ownership", this will allow you to use chmod and tools to change users where required.

Related

Elixir Phoenix and Symlinks on Windows SMB Drive

So I have an interesting issue that I just can't figure out why I'm getting this and what to do.
So basically I store all my development projects on my Synology NAS for local access between my various devices. There has never been a problem with this until I started playing around with Elixir and more importantly Phoenix. The issue I am getting is when running mix phx.server. I get the following
[warn] Phoenix is unable to create symlinks. Phoenix' code reloader will run considerably faster if symlinks are allowed. On Windows, the lack of symlinks may even cause empty assets to be served. Luckily, you can address this issue by starting your Windows terminal at least once with "Run as Administrator" and then running your Phoenix application.
[info] Running DiscussWeb.Endpoint with cowboy 2.7.0 at 0.0.0.0:4000 (http)
[error] Could not start node watcher because script "z:/elHP/assets/node_modules/webpack/bin/webpack.js" does not exist. Your Phoenix application is still running, however assets won't be compiled. You may fix this by running "cd assets && npm install".
[info] Access DiscussWeb.Endpoint at http://localhost:4000
So I tried as it stated and ran it in CMD as admin but to no avail. After some further inspection I tried to create the symlinks manually but every time I tried I would get a Access is denied. error (yes this is elevated CMD).
c:\> mklink "z:\elHP\deps\phoenix" "z:\elHP\assets\node_modules\phoenix"
Access is denied.
So I believe it is something to do with the fact that the symlinks are trying to be created on the NAS because if I move the project and host it locally it will work. Now I know what you're thinking. Yes, I could just store them locally on my PC but I like to have them available between PCs without having to transfer files or rely on git etc. (i.e. offline access), not to mention that the NAS has a full backup routine.
What I have tried:
Setting guest read write access on the SMB share
Adding to /etc/samba/smb.conf on my Synology NAS:
[global]
unix extensions = no
[share]
follow symlinks = yes
wide links = yes
Extra logging on SMB to see what is happening when I try it (nothing extra logged)
Creating a symbolic link from my MAC (works)
Setting all of fsutil behavior query SymlinkEvaluation to enabled
At the moment I am stuck and unsure of what to try next, or even if it is possible. Considering just using NFS instead but will I face the same issues with SMB?
P.S I faced a similar issue with Python venvs a while ago, just a straight-up Access is denied. error and just gave up and moved just the venv locally and kept the bulk of the code on the NAS. (This actually ended up beingthe best solution for that because the environments of each device on my network clashed etc.)
Any ideas are greatly appreciated.

How to unhide the /Users folder while in Recovery Mode in OSX

I'm trying to access some files in my home directory on my macbook, using the terminal on recovery mode. In a normal boot, I can do:
sudo chflags nohidden /Users
to unhide the Users folder, but this is not working on recovery mode. I've tried this:
diskutil list
but no encrypted and/or offline Volumes appear. Does someone know how can I access my files?
Ok, so I just needed to mount the partition from Disk Utility, using File->Mount with the correct partition selected. After that, I can access my data.

Get actual moint point of network volume in osx cli

In an automated system, i copy files to a mounted network volume with a sh
In basic i do "cp file.pdf /Volumes/NetworkShare/".
This works well until the remote system is down.
So before copying i can do a ping to detect if it's online.
But... when i get online OSX often remounts on a different path "/Volumes/NetworkShare-1/".
The old path "/Volumes/NetworkShare/" stil exists altough it's useless.
So, how can i find the actual mount point of this share in OSX cli?
I found out that diskutil does something like this for local disks, not for network volumes. Is there an equivalent for diskutil for network volumes?
The mount command (just on its own) will list all mounted filesystems. As for why OS X is creating that extra directory, that is pretty odd. Did you manually mount the filesystem, by any chance? If you created the “NetworkShare” directory yourself, OS X’s auto mounter might do what you’re suggesting.

Magento Unable to Rebuild Image Cache

I have transfered my magento from old host to a new host. Everything is running ok except to the product's images. I found that Magento is unable to generate image Cache folder under media/catalog/product/cache. I have followed all solutions on the internet but I couldn't find a solution. This is what I have done so far.
Change permission to 777 and double check on owner and group for Cache folder under media/catalog/product/cache and var/cache but nothing change.
Reindex data, clean cache, regenerate image cache million of times.
Double check for GD installation
Double check disk space. I still have about 4G.
Delete any .htaccess under that folder.
I spend a lot of time to check and try, check and try again but nothing work.
Could anyone please help me to solve this problem
You need media/tmp as well. If it's not present at the moment, create it.
$ cd /path/to/your/magentoRoot/
$ mkdir media/tmp
$ chmod 777 media/tmp
Additionally, make sure www-data or any other user that runs the web (nginx / apache2 or php-fpm processes) can at least read and write to the whole media/ folder.
Move and replace media folder from old host to new host. It will probably be get all your product images.
Please check the maximum memory size in php-fpm and php.ini file if it is -1 than set to 1024Mb
This happened to me on copying a live site onto a local Fedora Linux machine to test out an upgrade process. Issues are likely to be related to the Apache server not having permissions to write. So be aware of SELinux preventing Apache writing to the file system and also that your Magento files are writable by the Apache user.

How can I move MySQL data directory on Mac OS 10.5? (and related questions)

I've managed to mess up my MySQL database (on Mac OS X 10.5) and need help recovering!
I tried to add an index to a fairly large table (190 million records) and in the course of this, I ran out of disk space. Subsequently realized that the partition with the data directory is too small and so I need to move it.
Initially I thought that I would just copy the data directory to another location, then bung a symlink in place of the original data directory.
BUT it refuses to move!
sudo cp -r /usr/local/mysql/data .
cp: ./data: Permission denied
(I have stopped the mysqld process before attempting this move)
Help!
This isn't a mysql question, but rather an OS question.
I would guess that you either don't have permission to write to the current directory, or there's already a directory there named 'data' that you don't have permission on, etc.
In my experience, MySQL doesn't like running out of disk space at all. Make sure the last records are OK after you bring the engine back up.
Also, don't use the symlink - change the mysql config. In Unix, this would be the 'datadir' setting in /etc/my.cnf.

Resources