-
Notifications
You must be signed in to change notification settings - Fork 10
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
Symlink /app to real app dir #1
Comments
@jkutner I'm posting here the full output for you from my usage of pack based on your gist Current output:
Stacks
The elixir_buildpack.config
Note that Finally the buildpack.toml from the elixir-cnb project: [buildpack]
id = "hashnuke.elixir"
version = "0.1"
name = "Elixir"
[[stacks]]
id = "heroku-18" I thought I'd share the config so that you can see if I've misconfigured anything, and that it might be useful for debugging. Does
|
@hawksight i wasn't able to reproduce this with my sample app but I don't know much about elixir. I cloned the heroku-buildpack-elixir-test app, and added an Do you have an app I can clone and run against? |
Unfortunately all the apps are private so I can't share anything at the moment. But the app I've chosen is the simplest we have and as close to the sample app as I could get. I'll do some digging, there must be some reason why it fails to install hex & rebar. |
Ok not sure what I did but something's working now, or at least more than it did before!
I tried adding a version check before compiling and got:
So seems like the builder image needs to have get the same elixir version? Although It does install those versions previously, so seems a bit off that it returns to the 1.5 version. |
Actually please ignore that last update.. I just cleaned up the cached volumes and it seemed to work perfectly!
I rebuilt everything and the version check was spot on this time. So it must have been caching. |
@hawksight do you think the |
Im not sure if For example here's me shelling in to see whats going on:
I'll try and do some more debugging and see if I can get the app to run and elixir working inside the container. |
i've been playing around with this cnb-shim and the hashnuke-elixir buildpack. i was able to fix the
having fixed that, you'll see a new error: cnb@ac6a5af85afe:/workspace$ mix
/workspace/.platform_tools/erlang/bin/erl: 29: exec: /workspace/app/.platform_tools/erlang/erts-9.1/bin/erlexec: not found the erlexec binary we expected to find can't be found because of a broken symlink: cnb@ac6a5af85afe:/workspace$ ls -la /workspace/app/.platform_tools/
total 8
drwxr-xr-x 2 cnb cnb 4096 Jan 1 1980 .
drwxr-xr-x 3 cnb cnb 4096 Jan 1 1980 ..
lrwxrwxrwx 1 cnb cnb 35 Jan 1 1980 erlang -> /layers/hashnuke.elixir/shim/erlang that cnb@fa78b3081c0d:/workspace$ mix
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
Could not find Hex, which is needed to build dependency :arc
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn]
17:31:44.428 [error] Unable to load crypto library. Failed with error:
":load_failed, Failed to load NIF library /workspace/app/.platform_tools/erlang/lib/crypto-4.1/priv/lib/crypto: 'libcrypto.so.1.0.0: cannot open shared object file: No such file or directory'"
OpenSSL might not be installed on this system.
17:31:44.431 [warn] The on_load function for module crypto returned:
{:error, {:load_failed, 'Failed to load NIF library /workspace/app/.platform_tools/erlang/lib/crypto-4.1/priv/lib/crypto: \'libcrypto.so.1.0.0: cannot open shared object file: No such file or directory\''}}
** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :supported_protocol_versions, 1, [file: 'tls_record.erl', line: 407]}, {:tls_record, :supported_protocol_versions, 0, [file: 'tls_record.erl', line: 247]}, {:ssl, :handle_options, 3, [file: 'ssl.erl', line: 709]}, {:ssl, :connect, 4, [file: 'ssl.erl', line: 115]}, {:http_transport, :connect, 4, [file: 'http_transport.erl', line: 109]}, {:httpc_handler, :connect, 4, [file: 'httpc_handler.erl', line: 790]}, {:httpc_handler, :connect_and_send_first_request, 3, [file: 'httpc_handler.erl', line: 802]}]}}}]}
Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv. at this point i've decided to roll my own elixir CNB buildback, but i |
Sounds like Stack Buildpacks will allow us to create/modify the |
@hone we addressed this by modifying cnb-shim to add a |
@kamaln7 we are facing a similar problem and we would be interested in your solution. |
@Haegi sure, here you go: https://github.com/kamaln7/cnb-shim/blob/773a0821c2e94423c53c6249f95b0a393030a1f6/bin/build#L40-L44 Can you let me know if it works for you please? |
@kamaln7 thanks for sending me the snippet, unfortunately, it didn't work in my case. I also tried just adding a file with the same method but the I couldn't find the file. Snippet to add a file: cat <<'EOF' >"${profile_dir}/profile.d/cnb_shim_symlink.sh"
touch $(pwd)/text.txt
EOF To see if there is any file: # build
pack build <my-path> --path <path-to-artefact> --builder heroku/buildpacks --buildpack ~/path/to/cnb
# test
docker run -it --rm --entrypoint /bin/bash <my-app> |
@Haegi docker run -it --rm --entrypoint launcher <my-app> bash
# that should work, but if not, try the absolute path
docker run -it --rm --entrypoint /cnb/lifecycle/launcher <my-app> bash That way, Update: another issue with the fix I linked earlier that @Haegi ran into was that the buildpack they used didn't write profile scripts. The |
create /app/.heroku symlink if needed
Unfortunately, since CNBs don't have root permissions during the build it will never be possible to implement this feature in a spec compliant way (the real workspace directory location will only be known during the build since it's dynamic, but it's only during run image creation that there are sufficient permissions to create the symlink). This issue amongst others is one of the reasons why this project is likely to be sunset soon. See: |
The cnb-shim should create a symlink from
/app
to/workspace/app
(or wherever the real app directory is). This will prevent problems with buildpacks that hard code references to/app
The text was updated successfully, but these errors were encountered: