Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

env.sh conflicts on OSX #11

Closed
Etaggel opened this issue Jun 3, 2019 · 6 comments
Closed

env.sh conflicts on OSX #11

Etaggel opened this issue Jun 3, 2019 · 6 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers Usage Relates to usage

Comments

@Etaggel
Copy link

Etaggel commented Jun 3, 2019

Hi,

When running the source rl_coach/env.sh on a mac, the following errors are thrown:

hostname: illegal option -- i
usage: hostname [-fs] [name-of-host]
readlink: illegal option -- f
usage: readlink [-n] [file ...]

Looking around the web, readlink on OSX isn't standard (naturally). But a port of it can be installed by:

brew install coreutils

That then gives a greadlink that works in the same way as on other platforms (i.e. it supports the -f option).

I think the -i on hostname is trying to get the IP address of the local machine? On OSX that can be got with:

ipconfig getifaddr en0

But that's perhaps a little brittle as you need to specify which network interface to check. The following command is a little less brittle, but returns multiple IPs (for each interface):

ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'

Or perhaps just limit the grep to give a single result:

ifconfig | grep "inet " | grep -m 1 -Fv 127.0.0.1 | awk '{print $2}'

I just tested that with my wifi + LAN on/off and it did detect the switch over correctly (i.e. always giving me an active IP). So maybe that's the solution?

@crr0004 crr0004 added bug Something isn't working good first issue Good for newcomers Usage Relates to usage labels Jun 5, 2019
@crr0004
Copy link
Collaborator

crr0004 commented Jun 5, 2019

Yep it gets the IP of the host so it can be passed into any S3 clients as the endpoint url so minio can be used as an S3 store.

@joezen777
Copy link

I documented all my workarounds for Mac Pro. Thanks for sharing!
https://gist.github.com/joezen777/6657bbe2bd4add5d1cdbd44db9761edb

@crr0004
Copy link
Collaborator

crr0004 commented Jun 16, 2019

Much appreciated. I will look at baking it into the scripts/improving the setup for OSX. For now I will put that link in the readme

@daj
Copy link

daj commented Nov 12, 2019

FYI, I found this guide (based on joezen777's original guide) for installing on the Mac from the DeepRacer Slack group.

@daj
Copy link

daj commented Nov 16, 2019

Fix attempted in PR #78.

@breadcentric
Copy link
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers Usage Relates to usage
Projects
None yet
Development

No branches or pull requests

5 participants