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

Commit

Permalink
Update to lts-11.22 packages
Browse files Browse the repository at this point in the history
Reviewers: jeeva

Subscribers: #helix_omniscient

Differential Revision: http://phab.helixta.com.au/D22316
  • Loading branch information
timbod7 committed Feb 20, 2019
1 parent cb5b8dc commit e539cb8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
10 changes: 5 additions & 5 deletions hx-deploy-tool.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ executable hx-deploy-tool
default-language: Haskell2010
build-depends: base >= 4.7 && < 5
, aeson >= 1.0 && < 1.3
, amazonka >= 1.4 && < 1.6
, amazonka-core >= 1.4 && < 1.6
, amazonka-ecr >= 1.4 && < 1.6
, amazonka-route53 >= 1.4.5 && < 1.6
, amazonka-s3 >= 1.4 && < 1.6
, amazonka >= 1.4 && < 1.7
, amazonka-core >= 1.4 && < 1.7
, amazonka-ecr >= 1.4 && < 1.7
, amazonka-route53 >= 1.4.5 && < 1.7
, amazonka-s3 >= 1.4 && < 1.7
, base64-bytestring >= 1.0 && < 1.1
, binary >= 0.8.5.1 && < 0.9
, bytestring >= 0.10 && < 0.11
Expand Down
10 changes: 7 additions & 3 deletions src/Blobs/S3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ module Blobs.S3(
mkAwsEnv
) where

import qualified Data.ByteString as BS
import qualified Data.Text as T
import qualified Network.AWS.S3 as S3
import qualified Data.Conduit.List as CL

import Data.Conduit((.|), ($$), ($$+-))
import Data.Conduit((.|), ($$+-), ConduitT, sealConduitT, runConduit)
import Data.Conduit.Binary(sinkFile)
import Data.Monoid
import Data.Maybe(catMaybes)
Expand Down Expand Up @@ -64,7 +65,10 @@ downloadFileFrom env bucketName objectKey toFilePath retryAfter = do
handling _ServiceError onServiceError $ do
runResourceT . runAWST env $ do
resp <- send (S3.getObject bucketName objectKey)
liftResourceT (_streamBody (view S3.gorsBody resp) $$+- sinkFile toFilePath)
let src = _streamBody (view S3.gorsBody resp) :: ConduitT () BS.ByteString (ResourceT IO) ()
sink = sinkFile toFilePath :: ConduitT BS.ByteString o0 (ResourceT IO) ()
stream = (sealConduitT src) $$+- sink
liftResourceT stream
where
onServiceError :: ServiceError -> IO ()
onServiceError se =
Expand All @@ -78,7 +82,7 @@ listFiles :: Env -> S3.BucketName -> S3.ObjectKey -> IO [T.Text]
listFiles env bucketName (S3.ObjectKey prefix) = do
let listObjectReq = set S3.loPrefix (Just prefix) (S3.listObjects bucketName)
runResourceT . runAWST env $ do
objects <- paginate listObjectReq $$ CL.foldMap (view S3.lorsContents)
objects <- runConduit (paginate listObjectReq .| CL.foldMap (view S3.lorsContents))
let sortedObjects = reverse (sortOn (view S3.oLastModified) objects)
return (catMaybes (map (\o -> view S3.oKey o ^? S3.keyName '/') sortedObjects))

Expand Down
6 changes: 3 additions & 3 deletions src/Commands/ProxyMode/RemoteState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Control.Monad.IO.Class
import Control.Monad.Trans.AWS
import Control.Monad.Trans.Resource
import Control.Lens
import Data.Conduit((.|), ($$), ($$+-), (=$), ResumableSource)
import Data.Conduit((.|), ($$+-), (=$), sealConduitT, runConduit)
import Data.Traversable(for)
import Data.Maybe(catMaybes)
import Data.Monoid
Expand Down Expand Up @@ -61,7 +61,7 @@ getSlaves remoteStateS3 = do
let (bucketName,S3.ObjectKey bucketPath) = S3.splitPath (remoteStateS3 <> "/slaves")
listObjectReq = set S3.loPrefix (Just bucketPath) (S3.listObjects bucketName)
objects <- runResourceT . runAWST env $ do
paginate listObjectReq $$ CL.foldMap (view S3.lorsContents)
runConduit (paginate listObjectReq .| CL.foldMap (view S3.lorsContents))
let keys = catMaybes [view S3.oKey obj ^? S3._ObjectKey | obj <- objects]
let labels = catMaybes (map parseSlaveLabel keys)
return labels
Expand Down Expand Up @@ -93,7 +93,7 @@ stateFromS3 env s3Path = do
handling _ServiceError onServiceError $ do
runResourceT . runAWST env $ do
resp <- send (S3.getObject bucketName objectKey)
lbs <- fmap LBS.fromChunks $ liftResourceT (_streamBody (view S3.gorsBody resp) $$+- CL.consume)
lbs <- fmap LBS.fromChunks $ liftResourceT (sealConduitT (_streamBody (view S3.gorsBody resp)) $$+- CL.consume)
case adlFromByteString lbs of
(ParseFailure e ctx)
-> error (T.unpack ("Failed to parse state adl at " <> s3Path <> ": " <> e <> " at " <> textFromParseContext ctx))
Expand Down
2 changes: 1 addition & 1 deletion src/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ unpackRelease modifyContextFn release toDir = do
bs_fetchToFile bs release releaseFilePath

-- expand the zip file
withArchive (toFilePath releaseFilePath) (unpackInto (toDirPath toDir))
withArchive releaseFilePath (unpackInto toDir)

-- load the release metadata
rcfg <- adlFromJsonFile' (toDir </> "release.json")
Expand Down
5 changes: 3 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flags: {}
resolver: lts-10.10
resolver: lts-11.22
packages:
- '.'
- location:
Expand All @@ -11,7 +11,8 @@ packages:
- haskell/compiler-lib
- haskell/compiler
extra-dep: true
extra-deps: []
extra-deps:
- amazonka-secretsmanager-1.6.0
extra-package-dbs: []
nix:
packages: [zlib, bzip2]

0 comments on commit e539cb8

Please sign in to comment.