harris-chris / Jot.jl

Streamlines the creation and management of AWS Lambda functions written in Julia
MIT License
41 stars 6 forks source link

ERROR: Unsatisfiable requirements detected for package Jot [1043c0aa]: #30

Closed kafisatz closed 1 year ago

kafisatz commented 2 years ago

Any ideas why I would run into the error below? I am on Windows, but I don't think the error is related to the OS.

using GT7CarAlert
using Jot

responder = get_responder(GT7CarAlert, :response_func, Vector{String})
use_pc = false

julia> local_image = create_local_image(responder,julia_base_version="1.6.6",package_compile = use_pc)        
[+] Building 15.8s (14/19)
 => [internal] load build definition from Dockerfile                                                     0.0s 
 => => transferring dockerfile: 1.17kB                                                                   0.0s 
 => [internal] load .dockerignore                                                                        0.0s 
 => => transferring context: 2B                                                                          0.0s 
 => [internal] load metadata for docker.io/library/julia:1.6.6                                          11.8s 
 => [auth] library/julia:pull token for registry-1.docker.io                                             0.0s 
 => [ 1/14] FROM docker.io/library/julia:1.6.6@sha256:9ecd2bd191bc8b0a8e0f0b878f100917199a4654ea9121102  0.0s 
 => [internal] load build context                                                                        0.1s 
 => => transferring context: 144.08kB                                                                    0.1s 
 => CACHED [ 2/14] RUN apt-get update && apt-get install -y   build-essential                            0.0s 
 => CACHED [ 3/14] RUN mkdir -p /var/runtime/julia_depot                                                 0.0s 
 => CACHED [ 4/14] RUN mkdir -p /tmp                                                                     0.0s 
 => CACHED [ 5/14] RUN mkdir -p /var/runtime                                                             0.0s 
 => CACHED [ 6/14] WORKDIR /var/runtime                                                                  0.0s 
 => CACHED [ 7/14] RUN julia -e "using Pkg; Pkg.Registry.add("General"); "                               0.0s 
 => [ 8/14] COPY . .                                                                                     0.1s 
 => ERROR [ 9/14] RUN julia -e "using Pkg; Pkg.develop(path="/var/runtime/GT7CarAlert"); Pkg.instantiat  3.7s 
------
 > [ 9/14] RUN julia -e "using Pkg; Pkg.develop(path="/var/runtime/GT7CarAlert"); Pkg.instantiate(); ":       
#14 0.925    Resolving package versions...
#14 1.730 ERROR: Unsatisfiable requirements detected for package Jot [1043c0aa]:
#14 2.847  Jot [1043c0aa] log:
#14 2.847  ├─Jot [1043c0aa] has no known versions!
#14 2.847  └─restricted to versions * by GT7CarAlert [2a8c1adb] — no versions left
#14 2.847    └─GT7CarAlert [2a8c1adb] log:
#14 2.847      ├─possible versions are: 0.1.3 or uninstalled
#14 2.847      └─GT7CarAlert [2a8c1adb] is fixed to version 0.1.3
#14 2.847 Stacktrace:
#14 2.847   [1] check_constraints(graph::Pkg.Resolve.Graph)
#14 3.271     @ Pkg.Resolve /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Resolve/graphtype.jl:978
#14 3.338   [2] Pkg.Resolve.Graph(versions::Dict{Base.UUID, Set{VersionNumber}}, deps::Dict{Base.UUID, Dict{VersionNumber, Dict{String, Base.UUID}}}, compat::Dict{Base.UUID, Dict{VersionNumber, Dict{String, Pkg.Types.VersionSpec}}}, uuid_to_name::Dict{Base.UUID, String}, reqs::Dict{Base.UUID, Pkg.Types.VersionSpec}, fixed::Dict{Base.UUID, Pkg.Resolve.Fixed}, verbose::Bool, julia_version::VersionNumber)
#14 3.528     @ Pkg.Resolve /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Resolve/graphtype.jl:371
#14 3.529   [3] deps_graph(ctx::Pkg.Types.Context, uuid_to_name::Dict{Base.UUID, String}, reqs::Dict{Base.UUID, Pkg.Types.VersionSpec}, fixed::Dict{Base.UUID, Pkg.Resolve.Fixed})
#14 3.531     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:541
#14 3.531   [4] resolve_versions!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
#14 3.534     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:411
#14 3.534   [5] targeted_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel)
#14 3.536     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1229
#14 3.536   [6] tiered_resolve(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
#14 3.538     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1215
#14 3.538   [7] _resolve
#14 3.538     @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1235 [inlined]
#14 3.539   [8] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Vector{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
#14 3.590     @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Operations.jl:1272
#14 3.591   [9] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; shared::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Iterators.Pairs{Symbol, Base.PipeEndpoint, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.PipeEndpoint}}})
#14 3.641     @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:149
#14 3.641  [10] develop(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.PipeEndpoint, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
#14 3.661     @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:80
#14 3.661  [11] develop(pkgs::Vector{Pkg.Types.PackageSpec})
#14 3.662     @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:78
#14 3.662  [12] #develop#14
#14 3.663     @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75 [inlined]
#14 3.663  [13] develop
#14 3.663     @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:75 [inlined]
#14 3.664  [14] develop(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::String, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
#14 3.667     @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:98
#14 3.667  [15] top-level scope
#14 3.668     @ none:1
------
executor failed running [/bin/sh -c julia -e "using Pkg; Pkg.develop(path=\"/var/runtime/GT7CarAlert\"); Pkg.instantiate(); "]: exit code: 1
ERROR: failed process: Process(setenv(`docker build --rm --iidfile id --tag 781406217097.dkr.ecr.eu-central-1.amazonaws.com/gt7caralert:latest .`; dir="C:\\Users\\BERNHA~1.KON\\AppData\\Local\\Temp\\jl_mWNP3Z"), ProcessExited(1)) [1]

Stacktrace:
 [1] pipeline_error
   @ .\process.jl:525 [inlined]
 [2] run(::Cmd; wait::Bool)
   @ Base .\process.jl:440
 [3] run
   @ .\process.jl:438 [inlined]
 [4] create_local_image(responder::LocalPackageResponder{Vector{String}}; image_suffix::Nothing, aws_config::Nothing, image_tag::String, no_cache::Bool, julia_base_version::String, julia_cpu_target::String, package_compile::Bool, user_defined_labels::OrderedCollections.OrderedDict{String, String}, dockerfile_update::Jot.var"#173#177", build_args::OrderedCollections.OrderedDict{String, String})
   @ Jot C:\Users\bernhard.konig\.julia\packages\Jot\jzEEH\src\Jot.jl:284
 [5] top-level scope
   @ REPL[13]:1
kafisatz commented 2 years ago

Ok. It seems this issue arises when the Module that I use, has dependencies which are not registered.

I think there is no need to add Jot to my module. But my original question remains open, as I am actually using other unregistered packages for my module

kafisatz commented 2 years ago

An easy fix for my issue was to add one 'RUN' command to the Dockerfile (to explicitly install the package from the ULR) as follows:

function dockerfile_add_runtime_directories()::String
    pushover_url = "https://github.com/kafisatz/Pushover.jl#master"
  """
  RUN mkdir -p $julia_depot_path
  ENV JULIA_DEPOT_PATH=$julia_depot_path
  RUN mkdir -p $temp_path
  ENV TMPDIR=$temp_path
  RUN mkdir -p $runtime_path
  WORKDIR $runtime_path
  RUN julia -e "import Pkg; Pkg.add(url=\\\"$pushover_url\\\")"
  """
end