+
     hvf c                  s   ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ RIt^ R
IH t  Rt!]PD                  PG                  ]PH                  ^ ,          4      t%R R lt&R R lt']R R l4       t(]R R l4       t(ER1R R llt(ER1R R llt)]
PT                  ! ]+4      t,]PZ                  ! R4      t.]PZ                  ! R4      t/]PZ                  ! R4      t0]PZ                  ! R4      t1ER2t2]PZ                  ! R"4      t3R#t4R$ R% lt5R& R' lt6R( R) lt7R* R+ lt8R, R- lt9]PZ                  ! R.]Pt                  4      t;]R/ R0 l4       t<]R1 R2 l4       t<]R3 R4 l4       t<R5 R6 lt<R7 R8 lt=R9 R: lt>R; R< lt?R= R> lt@R? R@ ltARA RB ltBRC RD ltCRE RF ltDRG RH ltERI RJ ltFRK RL ltGRM RN ltHRO RP ltIER3RQ RR lltJRS RT ltKRU RV ltLRW RX ltMRY RZ ltNR[ R\ ltOR] R^ ltPR_ R` ltQRa Rb ltRRc Rd ltSRe Rf ltTER4Rg Rh lltU ! Ri Rj]4      tV ! Rk Rl4      tWER1Rm Rn lltXER3Ro Rp lltY ! Rq Rr]P                  4      t[ ! Rs Rt]P                  4      t\Ru Rv lt] ! Rw Rx4      t^ER5Ry Rz llt_R{ R| lt`R} R~ ltaR R ltbR R ltcR R ltdR R lteR R ltfR R ltgR R lth. ER6Oti ! R R4      tj]j! 4       tk ! R R]l4      tm ! R R4      tn ! R R4      to]n! ]kRR4      R R l4       tpR R ltq]n! ]kRR4      R R l4       tr]n! ]kR4      R R l4       ts]n! ]kRR4      R R l4       tt]n! ]kRR4      R R l4       tuR R ltvR R ltwER1R R lltxR R lty]n! ]kRR4      R R l4       tzR R lt{R R lt|R R lt}R R lt~ER1R R lltR R lt]n! ]kRR4      R R l4       tR R lt]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       tR R lt]n! ]kRR4      R R l4       tR R ltR R lt]n! ]kR R4      R R l4       t]n! ]kR!R4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kRR4      R R l4       t]n! ]kER ER4      ER ER l4       t]o! ]kR4      ER ER l4       t]o! ]kR4      ER ER l4       t]o! ]kR4      ER ER	 l4       t]o! ]kR4      ER
 ER l4       t]o! ]kR4      ER ER l4       t]o! ]k. ER7O4      ER ER l4       t]o! ]kR.4      ER ER l4       t]o! ]kR4      ER ER l4       t]o! ]kR4      ER ER l4       t]o! ]kR4      ER ER l4       t]o! ]kR4      ER ER l4       t]o! ]kRR.4      ER ER l4       t]o! ]k. ER8O4      ER ER l4       t]o! ]kR4      ER ER l4       t]o! ]kR4      ER  ER! l4       t]o! ]kRR.4      ER" ER# l4       t]o! ]kR.4      ER$ ER% l4       t]o! ]kER 4      ER& ER' l4       t]o! ]kR.4      ER( ER) l4       t]o! ]kRR.4      ER* ER+ l4       tER, ER- ltER. ER/ lt]+ER08X  d
   ]! 4        R# R# (9      )annotationsN)Task)Enum)Any)Callable)Iterable)Union)overload)dotenv_valuesz1.5.0c                    V ^8  d   QhRRRR/# )   list_objectr   returnbool format   "3/usr/lib/python3.14/site-packages/podman_compose.py__annotate__r   0   s            c                s    \        V \        4      '       * ;'       d*    \        V \        4      '       * ;'       d    \        V R 4      # )__iter__)
isinstancestrdicthasattr)r      &r   is_listr   0   s?    {C(( 	- 	-;--	- 	-K,r   c                    V ^8  d   QhRRRR/# )r   a	list[str]r   r   r   r   r   r   r   9   s     ( (y (Y (r   c                s.    \        \        R  V 4      4      # )c                s    V # Nr   )ir   r   <lambda>Zfilteri.<locals>.<lambda>:   s    r   )listfilter)r   r   r   filterir%   9   s    {A&''r   c               $    V ^8  d   QhRRRRRR/# )r   r!   	int | strfallbackintr   r   r   r   r   r   r   >   s     4 4y 4C 4C 4r   c                    R # r    r   r!   r(      &&r   try_intr-   =   s    14r   c               $    V ^8  d   QhRRRRRR/# )r   r!   r'   r(   Noner   
int | Noner   r   r   r   r   r   @   s     < <y <D <Z <r   c                r*   r    r   r+   r,   r   r-   r-   ?   s    9<r   c               r&   )r   r!   r'   r(   r0   r   r   r   r   r   r   r   C   s!      y J * r   c                X     \        V 4      #   \         d     T# \         d     T# i ; ir    )r)   
ValueError	TypeErrorr+   r,   r   r-   r-   C   s;    1v  O  O   
 ))))c               r&   )r   r!   r'   r(   zfloat | Noner   r   r   r   r   r   r   M   s!       l l r   c                r1   r    )floatr2   r3   r+   r,   r   	try_floatr6   M   s;    Qx  O  Or4   z^[~/\.]zU^(?:z|Z|O|U|r?shared|r?slave|r?private|r?unbindable|r?bind|(?:no)?(?:exec|dev|suid))$z[^-_a-z0-9]z	(\d+|\D+)pullpushbuildrunstartstopz&^(?:(\d+)[m:])?(?:(\d+(?:\.\d+)?)s?)?$Z10c               r
   )r   txtzint | str | Noner   r0   r   r   r   r   r   r   q   s     " "( "Z "r   c                sT   V '       g   R # \        V \        \        34      '       d   V # \        P	                  V P                  4       4      pV'       g   R # V^,          V^,          r2V'       d   \        V4      M^ pV'       d   \        V4      M^ p\        VR,          V,           4      # )Ng      N@)r   r)   r5   t_rematchstrip)r=   r?   Zminssec   &   r   str_to_secondsrC   q   sw    #U|$$
JJsyy{#Ea%(#3t9!D%*C td{S !!r   c               r
   )r   r   r   r   z	list[int]r   r   r   r   r   r      s     < <3 <9 <r   c                sh    \         P                  V 4       Uu. uF  p\        W4      NK  	  up# u upi r    )num_split_reZfindallr-   )r   r!      & r   ver_as_listrF      s+    #/#7#7#:;#:aGAM#:;;;s   /c               $    V ^8  d   QhRRRRRR/# )r   r   r   br   r   r   r   r   r   r   r      s!      S S T r   c                s^    \        T ;'       g    R 4      p\        T;'       g    R 4      pW#8  #  )rF   )r   rH   Za_lsZb_ls   &&  r   strverscmp_ltrL      s*    qwwBDqwwBD;r   c               rG   )r   	mount_strr   basedirr   dict[str, Any]r   r   r   r   r   r      s!     5 5 5s 5~ 5r   c                s   V P                  R 4      p/ pRp\        V4      ^8X  d   RT reMZ\        V4      ^8X  d#   Vw  rVVP                  R4      '       g   Vw  rdRpM(\        V4      ^8X  d   Vw  rVpM\        RV ,           4      hV'       d   \        P                  V4      '       d   Rp\        P                  R8w  g   \        P                  R8X  db   RV9  d[   \        P                  P                  \        P                  P                  V\        P                  P                  V4      4      4      pMRp\        T;'       g    RP                  R	4      4      p. p	V Fj  p
V
R
8X  d   RVR&   K  V
R8X  d   RVR&   K  V
R9   d   WR&   K,  \        P                  V
4      '       d   V	P                  V
4       KZ  \        RV
,           4      h	  RR	P                  V	4      /VR&   RVRVRV/VC# ):N/zcould not parse mount bindZntz.sockvolumerJ   ,roT	read_onlyrwFZconsistencyzunknown mount option propagationtypesourcetarget)Z
consistentZ	delegatedZcached)splitlen
startswithr2   dir_rer?   osnamepathZabspathjoin
expanduserr%   propagation_reappend)rM   rN   Zmount_aZmount_opt_dictZ	mount_opt	mount_srcZ	mount_dst
mount_typeZ
mount_optsZpropagation_optsopt   &&         r   parse_short_mountrk      s   ooc"G%'NI
7|q  $Y9	W	&	 ##C((#* II	W	*1'	i1I=>>V\\),, 
77d?rww$7)3KWbgg>P>PQZ>[(\]I 
)//r0056J$;*.N;'D[*/N;'99,/=)!!#&&##C( 4s:;;  ,SXX6F-GHN6
)) 	 r   c               (    V ^8  d   QhRRRRRRRR/# )r   composePodmanCompose
mount_dictrO   srv_namer   r   r   r   r   r   r   r      s,     # ##(6#BE##r   c                s   V P                   f   Q hRV9   d   V# VR,          R8X  Ed   V P                  pVP                  R4      pV'       d   VP                  V/ 4      ;'       g    / M/ pVP                  R4      pWQR&   V'       gP   V P                  V\        P
                  ! VR,          P                  R4      4      P                  4       4      VR&   V# V'       gd   VP                  R4      p\        V\        4      '       d   VP                  RV 4      VR&   V# V'       d	   V VR&   V# V P                    R	V 2VR&   V# )
z
in-place fix mount dictionary to:
- define _vol to be the corresponding top-level volume
- if name is missing it would be source prefixed with project
- if no source it would be generated
_volrY   rS   rZ   ra   r[   utf-8external_)
project_namevolsgetformat_namehashlibsha256encode	hexdigestr   r   )rm   ro   rp   rv   rZ   volra   rs      &&&     r   fix_mount_dictr      s:    +++&X%||).4txx#))r"wwv 6!--z(3::7CDNNPCK  wwz*H(D))&ll6fX?F
 	 !'F  ")!5!5 6ax@Fr   a  
    \$(?:
        (?P<escaped>\$) |
        (?P<named>[_a-zA-Z][_a-zA-Z0-9]*) |
        (?:{
            (?P<braced>[_a-zA-Z][_a-zA-Z0-9]*)
            (?:(?P<empty>:)?(?:
                (?:-(?P<default>[^}]*)) |
                (?:\?(?P<err>[^}]*))
            ))?
        })
    )
c               $    V ^8  d   QhRRRRRR/# )r   valuer   	subs_dictrO   r   r   r   r   r   r   r     s     A AD A^ A Ar   c                r*   r    r   r   r   r,   r   rec_subsr     s    >Ar   c               r   )r   r   r   r   rO   r   r   r   r   r   r   r     s     ? ?C ?N ?s ?r   c                r*   r    r   r   r,   r   r   r     s    <?r   c               r   )r   r   r   r   rO   r   r   r   r   r   r   r     s     I IH I IH Ir   c                r*   r    r   r   r,   r   r   r     s    FIr   c               r   )r   r   zdict | str | Iterabler   rO   r   r   r   r   r   r   r     s#     ! !) !n !I^ !r   c           	     s  a \        V \        4      '       d   RV 9   d~   \        V R,          \        4      '       da   SP                  4       oV R,          P                  4        UUu/ uF  w  r#VS9  g   K  W#bK  	  ppp\	        VS4      pSP                  V4       V P                  4        UUu/ uF  w  r#\	        VS4      \	        VS4      bK  	  p ppV # \        V \        4      '       d!   R V3R llp\        P                  WP4      p V # \        V R4      '       d   V  Uu. uF  p\	        VS4      NK  	  p pV # u uppi u uppi u upi )zR
do bash-like substitution in value and if list of dictionary do that recursively
environmentc               r
   )r   mzre.Matchr   r   r   r   r   r   r   Zrec_subs.<locals>.__annotate__'  s     	, 	,x 	,C 	,r   c                s  < V P                  R 4      e   R# V P                  R4      ;'       g    V P                  R4      pSP                  V4      pVR8X  d   V P                  R4      '       d   RpVe   \        V4      # V P                  R4      e   \        V P                  R4      4      hV P                  R4      ;'       g    R# )	ZescapedNZ$ZnamedZbracedrJ   ZemptyZerrdefault)Zgrouprw   r   RuntimeError)r   ra   r   r   s   &  r   convertZrec_subs.<locals>.convert'  s    wwy!-777#88qwwx'8DMM$'E{qwww// 5z!wwu~)"1775>22779%+++r   r   )
r   r   copyitemsr   updater   var_resubr   )r   r   kvZsvc_envsr   r!   s   &f     r   r   r     s+    %E!j}1Et&L&L!(I).})=)C)C)E\)ER[I[)EH\  )4HX&LQKKMZMDA!Y'!Y)??MZ& L% 
E3			, 	, 

7* L 

	#	#167A!Y'7L3 ] [$ 8s   &D;6D;/"E"Ec               r
   )r   srcz!dict[str, Any] | list[Any] | Noner   z	list[Any]r   r   r   r   r   r   :  s      7 I r   c                s    V f   . pV# \        V \        4      '       d1   V P                  4        UUu. uF  w  r#Ve   V RV 2MTNK  	  pppV# \        V 4      '       d   \	        V 4      pV# V .pV# u uppi )z_
given a dictionary {key1:value1, key2: None} or list
return a list of ["key1=value1", "key2"]
=)r   r   r   r   r#   )r   dstr   r   rB   r   norm_as_listr   :  s     { J 
C		@C		Lam1#Qqc
2L
 J	 
3i J eJ Ms   A2c               r
   )r   r   z.None | dict[str, str | None] | list[str] | strr   dict[str, str | None]r   r   r   r   r   r   K  s      D I^ r   c                s   V f   / pV# \        V \        4      '       d   \        V 4      pV# \        V 4      '       dd   V  Uu. uF  q"'       g   K  VP                  R^4      NK   	  ppV Uu. uF   p\	        V4      ^8X  d   TM
V^ ,          R3NK"  	  pp\        V4      pV# \        V \
        4      '       d%   RV 9   d   V P                  R^4      MV R3w  rEWE/pV# \        R4      hu upi u upi )zT
given a list ["key1=value1", "key2"]
return a dictionary {key1:value1, key2: None}
Nr   z"dictionary or iterable is expected)r   r   r   r\   r]   r   r2   )r   r   r!   r   keyr      &     r   norm_as_dictr   K  s    
 { J 
C		3i J 
(+11qqwwsA1=@ASSVq[qtTl2SA3i J 
C		*-*SYYsA&3+
l J =>> 2As   	C%C%+&C*c               r
   )r   inner_valuezdict | list | int | strr   r   r   r   r   r   r   r   `  s     
 
4 
 
r   c                sb   \        V \        4      '       dt   V P                  4       R R0,          '       g   \        R4      hV P	                  R V P	                  R4      4      pV P	                  RV P	                  R 4      4      pV RV 2# \        V 4      '       d   \        \        V 4      4      # V # )softhardz(expected at least one soft or hard limitrP   )r   r   keysr2   rw   r   norm_ulimitr   )r   r   r      &  r   r   r   `  s    +t$$!VV$444GHHv{v'>?v{v'>?q{<455r   c               rl   )r   rm   rn   netr   is_extr   r   r   r   r   r   r   r   m  s)     $ $m $# $s $WZ $r   c                s$   V'       d   V# V P                   f   Q hV P                  P                  \        P                  P
                  R4      pVRJ d-   V P                  V P                   P                  RR4      V4      # V P                  V4      # )NFT-rJ   )	ru   x_podmanrw   rn   XPodmanSettingKeyDEFAULT_NET_NAME_COMPATjoin_name_partsreplacerx   )rm   r   r   default_net_name_compats   &&& r    default_network_name_for_projectr   m  s    
+++%..22''?? $&&&w';';'C'CC'LcRRs##r   c               r
   )r   r   r   r   zbool | Noner   r   r   r   r   r   {  s      # + r   c                s    \        V \        4      '       d   V # \        V \        4      '       d#   V P                  4       p V R9   d   R# V R9   d   R# \        V \        4      '       d   V ^8X  d   R# V ^ 8X  d   R# R# )trueTFN)r   Z1)ZfalseZ0)r   r   r   lowerr)   r   r   r   try_parse_boolr   {  sf    %%M!N"%A:A:r   c               r.   )r   rm   rn   ro   rO   r   r/   r   r   r   r   r   r     s&     0_ 0_ 0_N 0_t 0_r   c                s   "   VP                  R4      pVR,          R8X  d   \        P                  P                  V P                  4      pVR,          p\        P                  P                  \        P                  P                  V\        P                  P                  V4      4      4      p\        P                  P                  V4      '       g    \        P                  ! VRR7       WAR&   R# VR,          R8w  g    V'       d   VP                  R	4      '       g   R# VR	,          pVP                  R
4      p\        P                  RWU4        V P                  P                  . RRV.4      G Rj  xL
 P                  R4      pR#   \         d     Li ; i L&  \        P                    EdY   pT'       d   \#        RT R24      ThTP                  R. 4      p	RRRT P$                   2RRT P$                   2.p
\'        T	4       F  pT
P)                  RT.4       K  	  TP                  R4      pT'       d   T
P)                  RT.4       TP                  R/ 4      pTP+                  4        F  w  rT
P)                  RT RT 2.4       K  	  T
P-                  T4       T P                  P                  . RT
4      G Rj  xL 
  T P                  P                  . RRT.4      G Rj  xL 
 P                  R4      p Rp?R# Rp?ii ; i5i)z9
inspect volume to get directory
create volume if needed
rq   rY   rR   rZ   TZexist_okNrS   ra   rs   z3podman volume inspect %s || podman volume create %sinspectrr   zExternal volume [] does not existslabelscreate--labelio.podman.compose.project=com.docker.compose.project=driver--driverdriver_opts--optr   )rw   r`   rb   realpathdirnamerc   rd   existsmakedirsOSErrorlogdebugpodmanoutputdecode
subprocessCalledProcessErrorr   ru   r   extendr   rf   )rm   ro   r}   rN   rg   vol_namer   rt   er   argsitemr   r   ri   r   s   &&              r   assert_volumer     s    
 ..
 C&V#''""7??3x(	GG$$RWW\\'277;M;Mi;X%YZ	ww~~i((I5  )8&X%S6{HWWZ FIICXX_>>((X	87LMMUUV]^   N(( _!28*<MNOUVV2&()=)=(>?)'*>*>)?@
 !(DKKD)* )"KKV,-ggmR0%++-JCKKSE5'"234 .Hnn##B$777>>((X	87LMMMUUV]^+_s   CLF
 ,LL2L"F 4F5F L
FLFLF L3BL<BLK'L+K.,L LLLc               r
   )r   
mount_descrO   r   r   r   r   r   r   r   r     s     "9 "9 "9C "9r   c                s(   V P                  R 4      pVf   Q hVR8X  d   V P                  R4      MRpV'       d
   VR,          MV P                  R4      pV R,          p. pV P                  VR4      '       d@   V P                  V/ 4      P                  R4      pV'       d   VP                  V RV 24       V P                  R	R
4      '       d   VP                  R4       VR8X  dm   V P                  R/ 4      pVP                  R4      pV'       d   VP                  RV 24       VP                  R4      p	V	'       d   VP                  RV	 24       VR8X  d9   V P                  R/ 4      p
V
P                  R4      pVe   VP                  V4       RP                  V4      pVR8X  d   RV RV RV 2P                  R4      # VR8X  d   RV RV RV 2P                  R4      # VR8X  d   RV RV 2P                  R4      # \	        RV,           4      h)rY   NrS   rq   ra   rZ   r[   rX   z-propagation=rV   FrU   tmpfssizeztmpfs-size=modeztmpfs-mode=rR   selinuxrT   ztype=bind,source=z,destination=ztype=volume,source=ztype=tmpfs,destination=unknown mount type:)rw   rf   rc   rstripr2   )r   rh   r}   rZ   r[   optsZ
mount_prop
tmpfs_optsZ
tmpfs_sizeZ
tmpfs_mode	bind_optsr   Zopts_strs   &            r   mount_desc_to_mount_argsr     s   '^^F3J!!!$.($:*..
 CS[Z^^H%=F!FD~~j$''^^J377F
KK:,mJ<@A~~k5))DW^^GR0
^^F+
KK+j\23^^F+
KK+j\23VNN62.	--	*KK xx~HV"6(-xq
KRRSVWWX$VHM&8*MTTUXYYW((<CCCHH
*Z7
88r   c               r.   )r   ulimitz str | dict[str, Any] | list[Any]podman_argsr   r   r/   r   r   r   r   r   r     s$     4 4"B 4QZ 4_c 4r   c           
     s:   V e   \        V \        4      '       d   VP                  RV .4       R # \        V 4      p V P	                  4        UUu. uF   w  r#RP                  V\        V4      4      NK"  	  p ppV  F  pVP                  RV.4       K  	  R # R # u uppi )Nz--ulimit{}={})r   r   r   r   r   r   r   )r   r   Z
ulimit_keyr   r!      &&   r   ulimit_to_ulimit_argsr     s    fc""
F34 "&)F 06||~/=+J z;{+CD/=   ""J?3  s   &Bc               r.   r   cntrO   r   r   r   r/   r   r   r   r   r   r     s!     ? ?. ?y ?T ?r   c                s>    \        V P                  R . 4      V4       R# )ulimitsN)r   rw   r   r   r,   r   container_to_ulimit_argsr     s    #'')R0+>r   c               r.   r   r   r   r   r   r   r     s'     E E EY ESW Er   c                sl    V P                  R 4      pVe   \        VP                  R. 4      V4       R# R# )r9   Nr   )rw   r   )r   r   r9      && r   container_to_ulimit_build_argsr     s0    GGGEeii	26D r   c               r&   )r   r   rO   rp   r   r   r   r   r   r   r   r     s!     % %. %C %C %r   c                s   V R ,          pVR9  d   \        RV,           4      hVR8X  d   V P                  R4      MRpV'       d
   VR,          MV P                  R4      pV'       g   \        RV R	V 24      hV R
,          p. p\        \        V P                  V/ 4      P                  RR4      P	                  R4      4      4      pVR8w  dJ   VP                  \        V P                  R/ 4      P                  RR4      P	                  R4      4      4       VP                  V4       V P                  R4      pVe   TP                  V'       d   RMR4       VR8X  d9   V P                  R/ 4      p	V	P                  R4      p
V
e   VP                  V
4       V RV 2pV'       d    VRRP                  V4      ,           ,          pV# )rY   rR   rS   r   rq   Nra   rZ   zmissing mount source for z on r[   rX   rJ   rT   rV   rU   rW   r   rP   )rR   rS   )	r2   rw   setr%   r\   r   r   rf   rc   )r   rp   rh   r}   rZ   r[   r   ZpropagationsrV   r   r   r   s   &&          r   mount_desc_to_volume_argsr     s   F#J++.;<<$.($:*..
 CS[Z^^H%=F4ZLXJOPP!FDwz~~j"=AA-QSTZZ[^_`aLVGJNN62$>$B$B=RT$U$[$[\_$`abKK {+IID40VNN62.	--	*KK XQvhDchhtn$$Kr   c               rl   )r   rm   rn   r   rO   rS   str | dict[str, Any]r   r   r   r   r   r   r   '  s,     5 55!/59M55r   c                s    VR ,          pV P                   p\        V\        4      '       d   \        W$4      p\	        WV4      # )_service)r   r   r   rk   r   )rm   r   rS   rp   rN   s   &&&  r   get_mnt_dictr   '  s:     :HooG&#"63'844r   c               (    V ^8  d   QhRRRRRRRR/# )	r   rm   rn   r   rO   rS   r   r   r   r   r   r   r   r   r   1  s,      !/9Mr   c                s"  "   \        WV4      pVR ,          pVR,          p\        W4      G Rj  xL
  V P                  '       d   VR8X  d   VR,          pVP                  R/ 4      p. pVP                  R4      pV'       d   VP	                  RV 24       VP                  R4      p	V	'       d   VP	                  RV	 24       V'       d    VR	R
P                  V4      ,           ,          pRV.# \        W#4      pRV.# \        V4      pRV.#  L5i)r   rY   Nr   r[   r   zsize=r   zmode=rP   rT   --tmpfs-vz--mount)r   r   prefer_volume_over_mountrw   rf   rc   r   r   )
rm   r   rS   rp   rh   r   r   r   r   r   s
   &&&       r   get_mount_argsr   1  s      '/F:HJ

(((''' (#DGR0JD>>&)DeD6N+>>&)DeD6N+chhtn,,t$$(:d|#F+Dt' )s(   -DDD<D,D0DADc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   rm   rn   r   rO   secretr   podman_is_buildingr   r   r   r   r   r   r   r   r   M  sA     y yy	y !y 	y
 yr   c                sB   V P                   f   Q h\        V\        4      '       d   TMVP                  R4      pV'       d   W@P                   P	                  4       9  d   \        RV RVR,           24      hV P                   V,          pVP                  R4      pVP                  R4      pRpRp	Rp
RpRpRpRp\        V\        4      '       dV   VP                  R	4      p
VP                  R
4      pVP                  R4      pVP                  R4      pVP                  R4      pV'       EdW   V P                  p\        P                  P                  \        P                  P                  V\        P                  P                  V4      4      4      pV'       d9   V
'       g   TpM"RV
9   d   \        RV RV
 R2R,           4      hT
pRRV RV 2.pMlV
'       g   RP                  V4      pM+V
P                  R4      '       g   V
'       d   T
MTpRV 2pMT
pRpRRRRRR/p VVV,          ,          pR!T R"T R"T 2.pV'       g   V'       g	   V'       d+   V
'       d   T
MTp\         P#                  R/VR,          V4       V# VP                  R#R$4      '       g   VP                  R%4      '       Ed   Y'       d   R&V 2MR,          p	Y'       d   R'V 2MR,          p	Y'       d   R(V 2MR,          p	Y'       d   R)V 2MR,          p	Y'       d   VR*8X  d   R+V
 2MR,          p	VP                  R%4      pR,pV'       d#   VV8w  d   \        VP                  VV4      4      hV
'       d(   W8w  d"   VR*8w  d   \        VP                  W4      4      hV
'       d'   VR*8w  d    \         P#                  R0VR,          V
V4       RR-P                  WI4      .# \        R.P                  WAR,          4      4      h  \         d!   p\        RT R2RT R 2,           4      ThRp?ii ; i)1z
podman_is_building: True if we are preparing arguments for an invocation of "podman build"
                    False if we are preparing for something else like "podman run"
NrZ   zERROR: undeclared secret: "z", service: r   filezx-podman.relabelrJ   r[   ZuidZgidr   rY   rQ   zERROR: Build secret "z" has invalid target "z". z6(Expected plain filename without directory as target.)z--secretzid=z,src=z/run/secrets/{}z/run/secrets/zro,rprivate,rbindZzz,zZZz,ZzERROR: Run secret "z& has invalid "relabel" option related z to SELinux "z". Expected "z" "Z" or nothing.--volumerP   rs   Fra   z,uid=z,gid=z,mode=z,type=envz,target=zZERROR: Custom name/target reference "{}" for mounted external secret "{}" is not supportedz{}{}z-ERROR: unparsable secret: "{}", service: "{}"zWARNING: Service %s uses secret %s with uid, gid, or mode. These fields are not supported by this implementation of the Compose filezjWARNING: Service "%s" uses target: "%s" for secret: "%s". That is un-supported and a no-op and is ignored.)declared_secretsr   r   rw   r   r2   r   r   r`   rb   r   rc   rd   r   r^   KeyErrorr   warning)rm   r   r   r   Zsecret_nameZdeclared_secretZsource_fileZx_podman_relabelZ	dest_fileZsecret_optsZsecret_targetZ
secret_uidZ
secret_gidZsecret_modeZsecret_typerN   Z	secret_idZ
volume_refrA   Zmount_optionsZ#selinux_relabel_to_mount_option_mapexcZext_nameZerr_strs   &&&&                    r   get_secret_argsr   M  s	    ##///&vs33&H9MK+-E-E-J-J-LL6vhl3z?J[\]]..{;O!%%f-K&**+=>IKMJJKK&$

8,ZZ&
ZZ&
jj(jj({//gg&&rww||GRWW=O=OP[=\']^ '	% +K=8N}o]`aNO 
 *	$I;eK=&IJJ !-44[A	"--c22'4m++C51	)	/M37S$T2R/!DEU!VV %Qyk=/&RSJ{#0-kCKK_J	  :u--1D1DV1L1Lzzl+rAzzl+rA}-"D}-"D]{V[G[-1acc #&&v.@ 	 K/W^^KBCC]9kU>RW^^MGHH[E1KKFJ FMM+CDD
7>>{PZO\ k   )+6\]%&6%77VWX s   %O3 3P>PPc               r.   r   r   r   r   r   r   r     s!     0 0~ 0I 0$ 0r   c                s2    \        W4       \        W4       R # r    )container_to_cpu_res_argscontainer_to_gpu_res_argsr   r,   r   container_to_res_argsr     s    c/c/r   c               r.   r   r   r   r   r   r   r     s!     0; 0;> 0;	 0;d 0;r   c                s   V P                  R / 4      pVP                  R/ 4      pVP                  R/ 4      pVP                  R. 4      pRpV F  pVP                  R4      pVf   K  VP                  R4      p	V	f   K1  VR8w  g   R	V	9  d   KA  VP                  R
R4      p
VP                  RR4      pVR8w  d4   \        V4      ^ 8  d$   V F  pVP                  RRV 234       K  	  RpK  V
R8w  d-   \        V
4       F  pVP                  RRV 234       K  	  RpK  VP                  R4       RpK  	  V'       d   VP	                  R4       R# R# )deploy	resourcesreservationsdevicesFr   NcapabilitiesZnvidiaZgpucountall
device_ids--deviceznvidia.com/gpu=Tz--security-opt=label=disable)r  znvidia.com/gpu=all)rw   r]   r   rangerf   )r   r   r   resr   r   Zgpu_onZdevicer   r   r   r  Z	device_id   &&           r   r   r     so    WWXr"F
**["
%C77>2.Ly"-GFH%>zz.1Xl!:

7E*ZZe4
3z?Q#6'	""%i[1$  (
 FE>"5\	""%i[1$  *
 F 
 	 I L 9: r   c               r.   r   r   r   r   r   r   r     s&     9D 9D> 9D	 9Dd 9Dr   c                s^   \        V P                  R 4      R4      p\        V P                  R4      R4      pV P                  R4      pV P                  R4      pV P                  R/ 4      pVP                  R/ 4      pVP                  R/ 4      p\        VP                  R 4      R4      p	VP                  R4      p
VP                  R	/ 4      pVP                  R4      pT	;'       g    TpV'       d   VP                  R
\	        V4      34       V'       d   VP                  R\	        V4      34       T
;'       g    TpV'       d+   VP                  R\	        V4      P                  4       34       T;'       g    TpV'       d+   VP                  R\	        V4      P                  4       34       V P                  R4      pVP                  R4      pVe0   Ve,   \	        V4      \	        V4      8w  d   \        RV RV R24      hVe   TMTpVe   VP                  R\	        V4      .4       R# R# )cpusNZ
cpu_sharesZ	mem_limitZmem_reservationr   r   limitsZmemoryr   z--cpusz--cpu-sharesz-mz--memory-reservation
pids_limitZpidsz%Inconsistent PIDs limit: pids_limit (z$) and deploy.resources.limits.pids (z) must be the samez--pids-limit)r6   rw   r-   r   r   r   r2   )r   r   Zcpus_limit_v2Zcpu_shares_v2Zmem_limit_v2Z
mem_res_v2r   r  r  Zcpus_limit_v3Zmem_limit_v3r   Z
mem_res_v3r  ZmemZmem_resr  Zdeploy_pidsZfinal_pids_limits   &&                 r   r   r     s    cggfot4MCGGL148M77;'L*+J WWXr"F
**["
%CWWXr"Ffjj0$7M::h'L77>2.L!!(+J))MDI
 	 
 	 
&
&,C
HNN
 	 &&JG"L 
 	 &J**V$K +"9z?c+..7
| D11<=OQ 
 &0%;z#NC0@,ABC $r   c               r
   )r   	port_descrO   r   r   r   r   r   r   r   r   =  s       3 r   c                s(   V P                  R 4      pV P                  RR4      pV P                  R4      pV P                  RR4      pV'       g   \        R4      hV'       d   V RV RV 2pMV'       d   V RV 2MT pVR8w  d   VRV 2,          pV# )	r[   	publishedrJ   host_ipprotocoltcpz'target container port must be specifiedrP   rQ   )rw   r2   )r	  Zcnt_portr
  r  r  retr   r   port_dict_to_strr  =  s    }}X&Hk2.ImmI&G}}Z/HBCC	9+Qxj1+41XJ'XJ58*~Jr   c               r
   )r   ports_inzDNone | str | list[str | dict[str, Any] | int] | dict[str, Any] | intr   r   r   r   r   r   r   r   N  s      Rr   c                s~   V '       g   . p \        V \        4      '       d   V .p \        V \        4      '       g   Q h. pV  Fy  p\        V\        4      '       d   \	        V4      pMC\        V\
        4      '       d   \        V4      pM!\        V\        4      '       g   \        R 4      hVP                  V4       K{  	  V# )$port should be either string or dict)r   r   r#   r   r  r)   r3   rf   )r  Z	ports_outportr   r   
norm_portsr  N  s     (C  :h%%%%IdD!!#D)Dc""t9DD#&&BCC  r   c               s(    V ^8  d   QhRRRRRRRR/# )r   net_descrO   	proj_namer   net_namer   r   r   r   r   r   r   r   b  s*     5 5n 5 5PS 5Xa 5r   c           
     s   R RRV 2RRV 2.pV P                  R. 4      p\        V4       F  pVP                  RV.4       K  	  V P                  R4      '       d   VP                  R4       V P                  R4      pV'       d   VP                  RV34       V P                  R	/ 4      pVP	                  4        F  w  rVP                  R
V RV	 234       K  	  V P                  R/ 4      p
V
P                  R4      pV'       d   VR8w  d   VP                  RV34       V
P                  R. 4      pV P                  R4      '       d   VP                  R4       V P                  R4      '       d   VP                  R4       V P                  R4      '       d;   VP                  RRP                  \        V P                  R4      4      4      34       V P                  R4      '       d7   \        V P                  R4      4      pV F  pVP                  RV.4       K  	  \        V\        4      '       d   V.pV F  pVP                  R4      pVP                  R4      pVP                  R4      pV'       d   VP                  RV34       V'       d   VP                  RV34       V'       g   Kv  VP                  RV34       K  	  VP                  V4       V# )r   r   r   r   r   Zinternalz
--internalr   r   r   r   r   ipamr   z--ipam-driverconfigZenable_ipv6z--ipv6zx-podman.disable_dnsz--disable-dnszx-podman.dns--dnsrT   zx-podman.routesz--routesubnetip_rangegatewayz--subnetz
--ip-rangez	--gateway)rw   r   r   rf   r   rc   r   r   )r  r  r  r   r   r   r   r   r   r   r  Zipam_driverZipam_config_lsZroutesZrouteZipam_configr  r  r  s   &&&                r   get_network_create_argsr  b  sp   
$YK0
%i[1D \\(B'FV$Y%& %||JL!\\(#FZ(),,}b1K!'')
WQug./0 *<<#D((8$K{i/_k23XXh+N||M""H||*++O$||N##HH\(,,~">?@
 	 ||%&&hll+<=>EKKE*+  .$''()%*??:.//),KKV,-KKx017KKg./ & 	KKKr   c               r.   )r   rm   rn   r   rO   r   r/   r   r   r   r   r   r     s&     M M= M~ M$ Mr   c                s  "   VP                  R4      pV'       d   R# V P                  f   Q hVP                  R4      pV'       d0   \        V\        4      '       d   \	        VP                  4       4      p\        T;'       g    V P                  4      pV F  pV P                  V,          ;'       g    / pVP                  R4      p\        V\        4      '       d   TM/ p\        WV4      pVP                  R4      ;'       g    VP                  R4      ;'       g    Tp V P                  P                  . RRV.4      G Rj  xL
  K  	  R#  L
  \        P                   d   p	T'       d   \        RT R	24      T	h\        Y@P                  T4      p
T P                  P                  . RT
4      G Rj  xL 
  T P                  P                  . RRT.4      G Rj  xL 
   Rp	?	EKS  Rp	?	ii ; i5i)
z
create missing networks
network_modeNnetworksrs   ra   networkr   zExternal network [r   )rw   ru   r   r   r#   r   r   default_netr  r   r   r   r   r   r   r  )rm   r   r   Zcnt_netsr  r   ext_descdefault_net_namer  r   r   rj   r   assert_cnt_netsr$    s     ''.
!C
+++wwz"HJx..(H;;(;(;<H##C(..Bj)'5562;G&Q<<'SS8<<+?SSCS	M..''I(7KLLL  M,, 	M"%7zAR#STZ[[*85I5I8TD..''It<<<..''I(7KLLLL	Msz   AG2<G2/G24AG2G2G2#"EEE
G2EG/'AG*5F86'G*G G*#G2*G//G2c               r.   r   rm   rn   r   rO   r   r   r   r   r   r   r   r     s"     - -M - -S\ -r   c                s   . pVP                  R 4      p\        V\        4      '       g   Q hVR,          pRV9   d   \        RV R24      hVR8X  d   VP	                  R4       V# VR8X  d   VP	                  RV 24       V# VP                  R	4      '       d   VP	                  RV 24       V# VR
8X  d   VP	                  R4       V# VP                  R4      '       d   VP	                  RV 24       V# VP                  R4      '       d   VP	                  RV 24       V# VP                  R4      '       dX   VP                  R^4      ^,          P                  4       pV P                  V,          ^ ,          pVP	                  RV 24       V# VP                  R4      '       d>   VP                  R^4      ^,          P                  4       pVP	                  RV 24       V# VP                  R4      '       d   V.pVP                  R4      '       d!   VP                  VP                  R4      4       V Uu. uF  pRV 2NK
  	  p	pVP                  R4      p
V
'       d   V	P	                  RV
 24       RV9   d   V R2MV R2pVP	                  RV RP                  V	4       24       V# \        P                  RV4       \        P                  ! ^4       V# u upi )r  service_namer  zCnetworks and network_mode must not be present in the same service [Z]Znonez--network=noneZhost
--network=Zslirp4netnsZprivatez--network=privateZpastazns:zservice:rP   z--network=container:z
container:Zbridge_aliasesalias=mac_addressmac=rT   zunknown network_mode [%s])rw   r   r   r2   rf   r^   r\   r@   container_names_by_servicer   rc   r   fatalsysexit)rm   r   net_argsr   r&  Z	other_srvZ	other_cntaliases_on_containeraliasnet_optionsr*  rj   r   get_net_args_from_network_moder4    s   H
''.
!Cc3~&LSQR^Q__`a
 	
 f}()B OA 
*SE*+> O= 
	&	&*SE*+: O9 
		+,6 O5 
	 	 *SE*+2 O1 
		*SE*+. O- 

	#	#IIc1%a(..0	66yA!D	.yk:;& O% 
	%	%IIc1%a(..0	.yk:;  O 
	!	! ,~77: ''
(;<5IJ5IEw'5IJggm,k]34#:QicU!9*SE#((;*?)@AB
 O 			-s3O Ks   :Kc               r.   r%  r   r   r   r   r   r     s!     4 4- 4n 4 4r   c                s`    VP                  R 4      pV'       d   \        W4      # \        W4      # )r  )rw   r4  get_net_args_from_networks)rm   r   r   r   r   get_net_argsr6    s)    
''.
!C
-g;;%g33r   c               r.   r%  r   r   r   r   r   r     s&     V V VN Vy Vr   c                s   . pVP                  R 4      pVR,          pV.pVP                  VP                  R. 4      4       VP                  R/ 4      pV'       gv   V P                  '       gV   V Uu. uF  pRV 2NK
  	  ppV'       d   VP                  RV 24       VP                  RRP	                  V4       24       V# V P                  / /p\        V4      '       d   V U	u/ uF  q/ bK  	  pp	M-VP                  4        U	U
u/ uF  w  rY;'       g    / bK  	  pp	p
VeO   VP                  4        F:  p
V
P                  R V
P                  R	4      4      pVf   K*  \        R
V RV R24      h	  VP                  4        EF  w  rV P                  P                  V4      ;'       g    / pVP                  R4      p\        V\        4      '       d   TM/ p\        WV4      pVP                  R4      ;'       g    VP                  R4      ;'       g    TpVP                  R4      pVP                  R4      pVP                  R4      pVP                  R VP                  R	4      4      p\        VP                  R. 4      4      pVf	   Ve   TpRp. pV'       d   VP                  RV 24       V'       d   VP                  RV 24       V'       d   VP                  RV 24       V'       d   VP                  RV 24       TP                  V Uu. uF  pRV 2NK
  	  up4       V'       d%   TP                  V Uu. uF  pRV 2NK
  	  up4       V'       d/   VP                  RV R2RP	                  V4      ,           4       EK	  VP                  RV 24       EK   	  V# u upi u up	i u up
p	i u upi u upi )r*  r&  r(  r  r)  r+  z--network=bridge:rT   Nzx-podman.mac_addresszconflicting mac addresses  and zL:specifying mac_address on both container and network level is not supportedrs   ra   zx-podman.interface_nameZipv4_addressZipv6_addressZaliaseszinterface_name=zip=zip6=r'  rP   )rw   r   r!  rf   rc   r   r   valuesr   r  r   r   r   r   )rm   r   r0  r*  r&  r1  Zmultiple_netsr2  r3  r   Z
net_configZnetwork_macZnet_Znet_config_r  r   r"  r#  r  Zinterface_nameZipv4Zipv6ZmacZaliases_on_nets   &&                      r   r5  r5    s   H''-(K~&L(>
B 78GGJ+M""" :NN9MVE7+9MKN""T+#78OO/0E/FGHO ,,b1 },9:MSbM:FSFYFYF[\F[?3..B.F[\ '..0J$..
G]8^_K&"0U;- P' '  1 +002##''-33j)-7-D-D6";G6R<<'SS8<<+?SSCS$)BC~.~. oom[__=S-TU%kooi&DE ;;2CK0@ABTF|,dV}-cU|, 	:NO:NfUG,:NOPnMnU& 0nMNOOj
!4sxx7LLMOOj
34W 3Z OQ O ;\b P  Ns$   1N&%N+N0N0N6
 N;
c          
     s,    V ^8  d   QhRRRRRRRRRR	/# )
r   rm   rn   r   rO   detachedr   no_depsr   r   r   r   r   r   r   r   I  s;     x xx!/x;?xQUxxr   c           	     s<  "   V P                   pVR ,          pRV 2.pV'       d   VP                  R4       VP                  RR4      pV'       d   VP                  RV 24       . pVP                  R. 4       F8  p	VP                  V P                  P                  V	P
                  . 4      4       K:  	  V'       d.   V'       g&   RP                  V4      p
VP                  RV
 24       \        VP                  R	4      4      pV F  pVP                  R
V.4       K  	  \        VP                  R4      4      pV F  pVP                  RV.4       K  	  VP                  R4      '       d   VP                  R4       VP                  R4      RJ d   VP                  R4       VP                  R. 4       F  pVP                  RV.4       K  	  VP                  R. 4       F  pVP                  RV.4       K  	  VP                  R. 4       F  pVP                  RV.4       K  	  VP                  R. 4       F  pVP                  RV.4       K  	  VP                  R. 4       F  pVP                  RV.4       K  	  VP                  R. 4       F  pVP                  RV.4       K  	  \        VP                  R4      4       F  pVP                  RV.4       K  	  \        VP                  R 4      4       F  pVP                  R!V.4       K  	  \        VP                  R"4      4       F  pVP                  R#V.4       K  	  VP                  R$. 4      p\        V\        \        34      '       d   V.pV F  p\        V\        4      '       d   R%V/pVR%,          pVP                  R&R'4      p\        P                  P                  \        P                  P                  VV4      4      p\        P                  P                  V4      '       g%   V'       g   K  \        R(P!                  V4      4      h/ p\#        V4      p\        V4      pV F  pVP                  R)V.4       K  	  K  	  \        VP                  R*/ 4      4      pV Fi  pR+V9   d   VP                  R)V.4       K  VV P$                  P'                  4       9   g   K@  VP                  R)V R+V P$                  V,           2.4       Kk  	  VP                  R,. 4      p\        V\        4      '       d   V.pV F  pVP                  R-V.4       K  	  VP                  R.. 4       F&  pTP                  \)        WV4      G R/j  xL
 4       K(  	  \+        W4      G R/j  xL
  VP                  \-        W4      4       VP                  R04      pVei   VP                  R1VP                  R2R34       24       VP                  R4/ 4      pTVP/                  4        UUu. uF  w  ppR5V R+V 2NK  	  upp,          pVP                  R6. 4       F  pVP                  \1        WV4      4       K   	  VP                  R7. 4       F  pVP                  R8V.4       K  	  VP                  R9. 4       F  pVP                  R:V.4       K  	  VP                  R;4      '       d   VP                  R<4       VP                  R=. 4      p\        V\        4      '       d   V.pV FY  p\        V\        4      '       d   \3        V4      pM!\        V\        4      '       g   \5        R>4      hVP                  R?V.4       K[  	  VP                  R@4      p V e   VP                  RAV .4       VP                  RB4      p!V!e   VP                  RCV!.4       VP                  RD4      e   VP                  REVRD,          .4       VP                  RF4      '       d   VP                  RGVRF,          .4       VP                  RH4      '       d$   VP                  RI\        VRH,          4      .4       VP                  RJ4      '       d   VP                  RK4       VP                  RL4      '       d   VP                  RMVRL,          .4       VP                  RN4      p"V"e   \        V"\        4      '       d?   V"P/                  4        F)  w  p#pVP                  RORPP!                  V#V4      .4       K+  	  M>\        V"\6        4      '       d   V" F  pVP                  ROV.4       K  	  M\5        RQ4      hVP                  RR4      '       d   VP                  RS4       VP                  RT4      '       d   VP                  RU4       VP                  RV4      '       d   VP                  RWVRV,          .4       VP                  RX4      p$V$e   V$RY8w  d   VP                  RZV$.4       VP                  R[4      e   VP                  R\VR[,          .4       \9        W4       \;        W4       VP                  R]4      '       d   VP                  R^4       VP                  R_4      '       d   VP                  R`VR_,          .4       VP                  Ra4      p%V%eT   \        V%\        4      '       d   \<        P>                  ! V%4      p%VP                  Rb\@        PB                  ! V%4      .4       VP                  Rc4      p&V&e   VP                  RdV&.4       VP                  Re4      '       d   VP                  RfVRe,          .4       VP                  Rg4      p'V'e   VP                  RhV'.4       VP                  Ri/ 4      p(\        V(\        4      '       g   \        Rj4      hV(P                  RkR4      p)V(P                  Rl4      p*V)'       d   Rm.p*V*'       Ed   \        V*\        4      '       d+   VP                  Rn\@        PB                  ! RoV*.4      .4       M\E        V*4      '       d   V*PG                  4       p*V*PI                  ^ 4      p+V+Rm8X  d   VP                  Rp4       MV+Rq8X  d)   VP                  Rn\@        PB                  ! V*4      .4       MdV+Ro8X  dD   \K        V*4      ^8w  d   \        Rr4      hVP                  Rn\@        PB                  ! V*4      .4       M\        RsV+ Rt24      h\        Ru4      hRvV(9   d   VP                  RwV(Rv,          .4       RxV(9   d   VP                  RyV(Rx,          .4       RzV(9   d   VP                  R{V(Rz,          .4       R|V(9   d$   VP                  R}\        V(R|,          4      .4       R~V9   d   \        R4      hRp,VP                  R. 4       F  p-VP                  RV-.4       K  	  VP                  R. 4       F  p.VP                  RV..4       K  	  VP                  RR4      '       d   VP                  R.4       VP                  R4      p/V/e+   R'p,VP                  RV/.4       \L        PO                  R4       V,'       g   VP                  VR,          4       VP                  R4      p0V0eh   \        V0\        4      '       d(   VP                  \<        P>                  ! V04      4       V# TP                  V0 Uu. uF  p\        V4      NK  	  up4       V#  E	L E	Lu uppi u upi 5i)ra   --name=-dpodrJ   z--pod=_depsrT   z--requires=security_optz--security-optr   z--annotationrV   z--read-onlyZ
http_proxyFz--http-proxy=falser   r   Zcap_addz	--cap-addZcap_dropz
--cap-dropZ	group_addz--group-addr   r  Zdevice_cgroup_rulesz--device-cgroup-ruleZdnsr  Zdns_optz	--dns-optZ
dns_searchz--dns-searchenv_filerb   requiredTzEnv file at {} does not exist-er   r   r   r   volumesNloggingz--log-driver=r   zk8s-fileZoptionsz
--log-opt=secretsZextra_hostsz
--add-hostexposez--expose
publishallz-Pportsr  -puserns_modez--usernsuser-uworking_dir-wZhostnamez
--hostnameZshm_sizez
--shm-sizeZ
stdin_open-iZstop_signalz--stop-signalsysctlsz--sysctlr   z%sysctls should be either dict or listtty--tty
privileged--privilegedZpidz--pidpull_policyr9   --pullrestartz	--restartZinitz--initz	init-pathz--init-path
entrypoint--entrypointplatform
--platformZruntimez	--runtimecpusetz--cpuset-cpushealthcheckz)'healthcheck' must be a key-value mappingZdisableZtestZNONEz--healthcheck-commandz	CMD-SHELLz--no-healthcheckZCMDz*'CMD_SHELL' takes a single string after itzunknown healthcheck test type [z8],                     expecting NONE, CMD or CMD-SHELL.z,'healthcheck.test' either a string or a listintervalz--healthcheck-intervaltimeoutz--healthcheck-timeoutZstart_periodz--healthcheck-start-periodZretriesz--healthcheck-retriesx-podmanz^Configuration under x-podman has been migrated to x-podman.uidmaps and x-podman.gidmaps fieldszx-podman.uidmapsz--uidmapzx-podman.gidmapsz--gidmapzx-podman.no_hostsz
--no-hostszx-podman.rootfsz--rootfszFWARNING: x-podman.rootfs and image both specified, image field ignoredimagecommand)(r   rf   rw   r   r,  ra   rc   r   r   r   r   r`   rb   r   r   r2   r   dotenv_to_dictenvironr   r   r$  r6  r   r   r  r3   r#   r   r   shlexr\   jsondumpsr   r   Zpopr]   r   r   )1rm   r   r9  r:  r   ra   r   r=  depsdep_srvZdeps_csvrA   Zsec_itemZannr   r!   cr   r@  rb   rA  dotenv_dictr   r   Ztmpfs_lsrS   Z
log_configZlog_optsr   r   rH  r  rJ  rK  rP  ZsysctlrU  rX  rZ  r\  r]  Zhealthcheck_disableZhealthcheck_testZhealthcheck_typerootfs_modeZuidmapZgidmaprootfsrb  s1   &&&&                                             r   container_to_argsrn  I  s     ooGv;DTF#$K4 
''%
C
VC5>*D777B'G66::7<<LM (G88D>[
34
sww~.
/C,h78 
sww}-
.CNA./ 
ww{=)
ww|%/0WWXr"Iq>* #WWY#K+, $WWZ$L!,- %R(M401 )	2&J-. '-r22D9: 3SWWU^,GT?+ -SWWY/0K./ 1SWW\23ND12 4wwz2&H(T3K((:aAy55T*GGRWW\\'489ww~~a  <CCAFGG$Q';'Aay)   sww}b1
2C!8ay) GOO((**""DQCq1C0D*E#FG  www#H(C  :Iq>* '')R(f!EEF ) '
'''|G12#J]:>>(J+O*PQR>>)R0x~~GWXGWe*TF!E73GWXX'')R(?7@A )WW]B'L!,- (WWXr"J?+ #
ww|4 GGGR E%dD!!#D)DD#&&BCCD$<(  ''-(KJ45776?DD$<(
ww})D#m"456
wwzL#j/:;
wwzL#c*o*>?@
ww|4 
ww}OS-?@Aggi Ggt$$!(""Jvu0M#NO "1&&""J?3  CDD
wwu~~7#
ww|>*
wwu~~GSZ01''-(K;'#9Hk23
wwy%KY89S.#+
wwv8$
ww{M3{+;<=&Jj#&&Z0JNDJJz,BCDwwz"HL(34
wwyKY89WWXFOV45 ''-,Kk4((DEE%//)U;"v."8&,,'

K)9:;   %&&/446/33A66)""#56!U*""$;TZZHX=Y#Z[![0'(A-$%QRR""$;TZZHX=Y#Z[ 56F5G H7 8 
 KLL [ 4k*6MNOK3[5KLM$8+n:UVW K3SY9O5PQR S&
 	

 K'',b1J/0 2'',b1J/0 2
ww"E**L>*WW&'FJ/0\]3w<(ggi Ggs##u{{734  81A89M F' Yx  9s   A|A+|=|B'|-J'||B,|B#|1|
2||A=|
|B,|D.|:0|+9|%'|C|%'|'|5C
| C |B|!|-H.|A|5A9|.|
|||c                  sX    ] tR tRtRtRtRtRtRtRt	Rt
R	tR
tRtRt]R R l4       tRtR# )ServiceDependencyConditioniD  Z
configuredZcreatedZexitedZhealthyZinitializedZpausedZremovingZrunningZstoppedZstoppingZ	unhealthyc               r
   )r   r   r   r   'ServiceDependencyCondition'r   r   r   r   r   Z'ServiceDependencyCondition.__annotate__R  s     c cs c'C cr   c                	s    V  F  pVP                   V8X  g   K  Vu # 	  R \        P                  R\        P                  R\        P                  /p W1,          #   \
         d    \        RT R24      hi ; i)Zservice_healthyservice_startedZservice_completed_successfullyzValue 'z3' is not a valid condition for a service dependency)r   ro  HEALTHYRUNNINGSTOPPEDr   r2   )clsr   ZmemberZdocker_to_podman_condrK   r   
from_valueZ%ServiceDependencyCondition.from_valueQ  s     F||u$  9AA9AA,.H.P.P!

	c(// 	cwug-`abb	cs   A A5r   N)__name__
__module____qualname____firstlineno__Z
CONFIGUREDZCREATEDZEXITEDrr  ZINITIALIZEDZPAUSEDZREMOVINGrs  rt  ZSTOPPING	UNHEALTHYclassmethodrv  __static_attributes__r   r   r   ro  ro  D  sM    JGFGKFHGGHIc cr   ro  c                  sf    ] tR tRtR R lt]R R l4       t]R R l4       tR R	 ltR
 R lt	Rt
R# )ServiceDependencyie  c               rG   )r   ra   r   	conditionr   r/   r   r   r   r   r   ServiceDependency.__annotate__f  s&     K KS KS KT Kr   c                	sF    Wn         \        P                  V4      V n        R # r    )_namero  rv  
_condition)selfra   r     &&&r   __init__ZServiceDependency.__init__f  s    
4??	Jr   c                   V ^8  d   QhRR/# r   r   r   r   r   r   r   r   r  k  s      c r   c                	    V P                   # r    )r  r  r   r   ra   ZServiceDependency.namej  s    zzr   c               r  )r   r   rp  r   r   r   r   r   r  o  s      7 r   c                	r  r    )r  r  r   r   r  ZServiceDependency.conditionn  s    r   c               r  )r   r   r)   r   r   r   r   r   r  r  s     K K# Kr   c                	sV    \        R V P                  3RV P                  3,           4      # )ra   r  )Zhashr  r  r  r   r   __hash__ZServiceDependency.__hash__r  s$    VTZZ(K+IIJJr   c               r
   )r   otherr   r   r   r   r   r   r   r   r  v  s      C D r   c                	s    \        V\        4      '       d;   V P                  VP                  8H  ;'       d    V P                  VP
                  8H  # R # F)r   r~  r  ra   r  r  )r  r  r,   r   __eq__ZServiceDependency.__eq__v  s;    e.//::+RR5??0RRr   )r  r  N)rw  rx  ry  rz  r  Zpropertyra   r  r  r  r}  r   r   r   r~  r~  e  s@    K    K r   r~  c               r   )	r   servicesrO   r&  r   start_point
str | Noner   zset['ServiceDependency']r   r   r   r   r   r   }  s,      ,/>Hr   c                s  a S'       g   VoW,          R,          pVP                  4        F  pVP                  V8X  d   K  V P                  VP                  4      pV'       g   K;  \        ;QJ d&    V3R lVR,           4       F  '       g   K   RM	  RM! V3R lVR,           4       4      '       d   K  \	        WP                  S4      pVP                  V4       K  	  V# )z5
return all dependencies of service_name recursively
r>  c              3  sB   <"   T F  pSVP                   8H  x  K  	  R # 5ir    ra   ).0xr  s   & r   	<genexpr>Zrec_deps.<locals>.<genexpr>  s     ?.>{aff$.>s   TF)r   ra   rw   Zanyrec_depsr   )r  r&  r  rh  dep_nameri  Znew_depss   &&f    r   r  r  }  s     "!'*DIIK==L(,,x}}-3?gg.>?333?gg.>???Hmm[AH   Kr   c               r.   )r   r  rO   with_extendsr   r   r/   r   r   r   r   r   r     s!     #! #! #!d #!t #!r   c                s   V P                  4        EF  w  r#\        4       pWCR&   V'       dM   VP                  R/ 4      P                  R4      pV'       d$   WR8w  d   VP                  \	        VR4      4       Kh  VP                  R/ 4      pVP                  4        UUu. uF  w  rx\	        WxR,          4      NK  	  pppVP                  V4       VP                  R. 4      p	\        V	4      '       g   V	.p	TP                  V	 U
u. uF%  p
\	        V
P                  R4      ^ ,          R4      NK'  	  up
4       V	 F]  p
RV
9   g   K  V
P                  R4      w  rR	W,          9  d   \        4       W,          R	&   W,          R	,          P                  V4       K_  	  EK  	  V P                  4        F  w  r#\        W4       K  	  R
# u uppi u up
i )zG
create dependencies "_deps" or update it recursively for all services
r>  extendsservicerq  
depends_onr  ZlinksrP   r(  N)	r   r   rw   addr~  r   r   r\   r  )r  r  ra   srvrh  extZdeps_lsr   r   Zlinks_lsrj  r  Z	dep_aliasr  r   	flat_depsr    sv    ^^%	'*uG'')R(,,Y7C;HH.s4EFG '',+DKMMOTODA$Q+7OTG777B'x   zHT\]T\q&qwws|A8IJT\]^Aax&'ggcl#X%7758UH&z2":.229= - &< ^^%	  & U ^s   G+G

c                  s    ] tR tRt]P
                  t]P                  tRt	R R lt
]R R l4       t]R R l4       tR	tR
# )OverrideTagi  z	!overridec               r
   )r   r   r   r   r/   r   r   r   r   r   OverrideTag.__annotate__  s     8 8c 8d 8r   c                	s$   V  \        V4      ^ 8  d   \        V^ ,          \        4      '       d   / V n        V F  p\        V^,          P                  \        4      '       dM   V^,          P                   Uu. uF  q3P                  NK  	  upV P                  V^ ,          P                  &   Kv  V^,          P                  V P                  V^ ,          P                  &   K  	  R# V Uu. uF  q"P                  NK  	  upV n        R# u upi u upi r    N)r]   r   tupler   r#   )r  r   r   r!   rK   r   r  ZOverrideTag.__init__  s    u:>jq599DJ d1gmmT22BFq'--0P-Q-0PDJJtAw}}-04QDJJtAw}}-  277**7DJ	 1Q 8s   8D*Dc               rG   )r   loaderr   noder   'OverrideTag'r   r   r   r   r   r    s!     ' 's '# '- 'r   c                	s,    \        VP                  4      # r    )r  r   ru  r  r  r  r   	from_yamlZOverrideTag.from_yaml  s    4::&&r   c               r.   )r   dumperr   datar  r   r   r   r   r   r   r   r    s&     A AS A A# Ar   c                	sN    VP                  V P                  VP                  4      # r    )represent_scalaryaml_tagr   ru  r  r  r  r   to_yamlZOverrideTag.to_yaml  s    &&s||TZZ@@r   r   N)rw  rx  ry  rz  yamlDumperyaml_dumper
SafeLoaderyaml_loaderr  r  r|  r  r  r}  r   r   r   r  r    sH    ++K//KH8 ' ' A Ar   r  c                  s    ] tR tRt]P
                  t]P                  tRt	]
R R l4       t]
R R l4       t]
R R l4       tR	tR
# )ResetTagi  z!resetc               r  r  r   r   r   r   r   ResetTag.__annotate__  s       r   c                	r  r    )r  )ru  r   r   to_jsonZResetTag.to_json  s    ||r   c               rG   )r   r  r   r  r   
'ResetTag'r   r   r   r   r   r    s!      s # * r   c                	s    \        4       # r    )r  r  r  r   r  ZResetTag.from_yaml  s
    zr   c               r.   )r   r  r   r  r  r   r   r   r   r   r   r   r    s!     9 9S 9
 9s 9r   c                	s:    VP                  V P                  R 4      # rI   )r  r  r  r  r   r  ZResetTag.to_yaml  s    &&s||R88r   r   N)rw  rx  ry  rz  r  r  r  r  r  r  r|  r  r  r  r}  r   r   r   r  r    sS    ++K//KH    9 9r   r  c               r   )r   coror   r_  zint | floatr   r   r   r   r   r   r     s!     $ $# $ $ $r   c                s   "    \         P                  ! W4      G Rj  xL
 #  L  \         P                   d   p\        ThRp?ii ; i5i)a  
Asynchronously waits for the given coroutine to complete with a timeout.

Args:
    coro: The coroutine to wait for.
    timeout (int or float): The maximum number of seconds to wait for.

Raises:
    TimeoutError: If the coroutine does not complete within the specified timeout.
N)asyncioZwait_forTimeoutError)r  r_  r   r   r   wait_with_timeoutr    s>     $%%d4444 $#$s0   A$ "$ A$ AA  AAc                  s    ] tR tRtRR]P
                  ! ]P                  4      3R R lltRR R llt	R	 R
 lt
R R ltRR R lltRR]! 4       /R R llltR R ltR R ltRtR# )Podmani  r   Fc          
     r   )r   rm   rn   podman_pathr   dry_runr   	semaphorezasyncio.Semaphorer   r/   r   r   r   r   r   Podman.__annotate__  s<     
# 
#
# 
# 	
#
 %
# 

#r   c                	s6    Wn         W n        W0n        W@n        R # r    )rm   r  r  r  )r  rm   r  r  r     &&&&&r   r  ZPodman.__init__  s     &"r   Nc               r   )	r   r   r   cmdr   cmd_argslist[str] | Noner   bytesr   r   r   r   r   r    s2     ] ]$]+.]?O]	]r   c           	     	s  "   V P                   ;_uu_4       GR j  xL
  T;'       g    . pV'       d   V P                  P                  V4      M. pV P                  .VOVNV,           V,           p\        P                  \        V4      4       \        P                  ! VR\        P                  P                  R\        P                  P                  / G R j  xL
 pVP                  4       G R j  xL
 w  rxVP                  f   Q hVP                  ^ 8X  d   TuuR R R 4      GR j  xL
  # \        P                  ! VP                  RP                  V4      V4      h ELC L Lq L=  + GR j  xL 
 '       g   i     R # ; i5i)Nstdoutstderr )r  rm   get_podman_argsr  r   infor   r  create_subprocess_execr   PIPEZcommunicate
returncoder   rc   )	r  r   r  r  xargscmd_lspZstdout_dataZstderr_datas	   &&&&     r   r   ZPodman.output  s!     >>>>~~2H9<DLL005"E&&::c:UBXMFHHS[!44 ' 2 2 7 7@G@R@R@W@W A ./]]_'<$K<<+++||q " ">> //chhv>NP[\\ "
 (= ">>>s   FEFE'B%E'E!E'1E#2(E'F'E%(F-1E'F!E'#E'%F'F	-E0.
F	9F	;	Fc               r
   )r   readerasyncio.StreamReaderr   r  r   r   r   r   r   r  %  s     1 1'; 1 1r   c                	sH  "    VP                  R 4      G Rj  xL
 #  L  \        P                  P                   d   pTP                  u Rp?# Rp?i\        P                  P
                   d/   pTP                  TP                  4      G Rj  xL 
 u Rp?# Rp?ii ; i5i)   
N)Z	readuntilr  Z
exceptionsZIncompleteReadErrorZpartialZLimitOverrunErrorZreadZconsumed)r  r  r   r   r   
_readchunkZPodman._readchunk%  st     	1))%0000!!55 	99!!33 	1QZZ0000	1sf   B"  B" BA	B
B" B0B1BBBBB"BB"c               r   )	r   r  r  sinkr   log_formatterr   r   r/   r   r   r   r   r   r  -  s,     ' '*'25'FI'	'r   c                	s  aaa
"   R o
R V
VV3R llpR V
VV3R llpVP                  4       '       g   V P                  V4      G Rj  xL
 pVP                  R4      p\        V4       F`  w  rV\	        V4      ^,
          8  d   V! V	P                  4       4       R o
K6  \	        V	4      ^ 8  g   KH  V! V	P                  4       4       Ro
Kb  	  K  S
'       d   \        SRR	7       R# R#  L5i)
Fc               r
   r   sr   r   r/   r   r   r   r   r   +Podman._format_stream.<locals>.__annotate__2  s     	= 	= 	= 	=r   c                V   < S'       d   \        V SR R7       R# \        SV SR R7       R# )
r   ZendNprintr  line_ongoingr  r     &r   _formatted_print_with_nlZ7Podman._format_stream.<locals>._formatted_print_with_nl2  s     ad-mQTt<r   c               r
   r  r   r   r   r   r   r  8  s     	; 	;3 	;4 	;r   c                r  )rJ   r  Nr  r  r  r   _formatted_print_without_nlZ:Podman._format_stream.<locals>._formatted_print_without_nl8  s     ad+mQTr:r   Nr  Tr  r  )Zat_eofr  r\   	enumerater]   r   r  )r  r  r  r  r  r  Zchunkpartsr!   Zpartr  s   &&ff      @r   _format_streamZPodman._format_stream-  s      	= 	=	; 	; --////&11EKK&E$U+s5zA~%,T[[];#(LY]/>#'L , t&  2s#   .C*C*C(	A#C*1%C*C*c               r   )	r   r   r   r  r   r  r  r   r/   r   r   r   r   r   r  N  s2     
- 
-
- 
- #	
-
 

-r   c           
     	s   \        \        \        T;'       g    . 4      4      pV'       d   V P                  P	                  V4      M. pV P
                  .VOVNV,           V,           p\        P                  R P                  V Uu. uF  p\        V4      NK  	  up4      4       \        P                  ! V P
                  .VO5!   R# u upi )r  N)r#   mapr   rm   r  r  r   r  rc   r`   Zexeclp)r  r   r  r  r  r  r!   s   &&&&   r   execZPodman.execN  s     CR0158,,S1b""6[6#6>I626a3q66234
		$"",V, 3s   C	task_referencec               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r   r   r   r  r   r  r  r  r  r  zset[asyncio.Task]r   r0   r   r   r   r   r   r  Z  sF     ; ;; ; #	;
 "; *; 
;r   c               	s  "   V P                   ;_uu_4       GR j  xL
  \        \        \        T;'       g    . 4      4      pV'       d   V P                  P                  V4      M. pV P                  .VOVNV,           V,           p\        P                  RP                  V Uu. uF  p\        V4      NK  	  up4      4       V P                  '       d    R R R 4      GR j  xL
  R # VEeJ   \        P                  ! VR\        P                  P                  R\        P                  P                  RR/ G R j  xL
 p	V	P                  f   Q hV	P                   f   Q h\        P"                  ! V P%                  V	P                  \&        P                  V4      4      p
VP)                  V
4       V
P+                  VP,                  4       \        P"                  ! V P%                  V	P                   \&        P                  V4      4      pVP)                  V4       VP+                  VP,                  4       M\        P                  ! VRR/ G R j  xL
 p	 V	P/                  4       G R j  xL
 p\        P                  RT4       TuuR R R 4      GR j  xL
  #  EL}u upi  EL ELh LU L>  \        P0                   d    \        P                  R4       T	P3                  4         \5        T	P/                  4       ^
4      G R j  xL 
 p L  \6         dC    \        P9                  R4       T	P;                  4        T	P/                  4       G R j  xL 
 p  Li ; ii ; i L  + GR j  xL 
 '       g   i     R # ; i5i)	Nr  r  r  Z	close_fdsFzSending termination signalz5container did not shut down after 10 seconds, killingzexit code: %s)r  r#   r  r   rm   r  r  r   r  rc   r  r  r  r   r  r  r  create_taskr  r.  r  Zadd_done_callbackdiscardwaitZCancelledErrorZ	terminater  r  r   kill)r  r   r  r  r  r  r  r  r!   r  Zout_tZerr_t	exit_codes   &&&&&$       r   r:   Z
Podman.runZ  s     >>>>CX^^45H9<DLL005"E&&::c:UBXMFHHSXXv6v!s1vv678||| ">> (!88"--22 #--22 $	  xx+++xx+++  ++''#**mL ""5)''(>(>?++''#**mL ""5)''(>(>? "88&RERR
/"#&&(N	 HH_i0c ">> 7	 "2 S +)) /56/&7"&E E EI# /KK WXFFH&'ffhI//M ">>>s  M=JM=+M AM %J9M M M="J #M=)AM ;J#<DM J&M J*)J(*J*.M M=MM=M  M=#M &M (J**:M%L
L
L
M 
AM	MM	MM M	MM M= M:	&M)'
M:	2M:	4	M=c               r  r   r   r   r   r   r   r   r   r    s      ) r   c           
     	s   "   V P                  . R RRRRV P                  P                   2RR.4      G Rj  xL
 P                  4       pVP	                  4       pV#  L$5i)r   ls--noheading--filter label=io.podman.compose.project=--format	{{.Name}}Nr   rm   ru   r   
splitlines)r  r   r  r   r   
network_lsZPodman.network_ls  sm     ++!6t||7P7P6QR  &( 	 $$&s   4AA%Ac               r  r  r   r   r   r   r   r    s       r   c           
     	s   "   V P                  . R RRRRV P                  P                   2RR.4      G Rj  xL
 P                  R4      pVP	                  4       pV#  L%5i)	rS   r  r  r  r  r  r  Nrr   r  )r  r   rC  r   r   	volume_lsZPodman.volume_ls  so     ++!6t||7P7P6QR  &/ 	 ##%s   4AA&A)rm   r  r  r  )rJ   N)rJ   NN)rw  rx  ry  rz  r  	Semaphorer.  maxsizer  r   r  r  r  r   r:   r  r  r}  r   r   r   r  r    s]     $'.'8'8'E
#]&1'B
-; -0E; ;z$ r   r  c               r   )r   r  rO   sub_dirr   r   r   r   r   r   r   r     s&     F F~ F F^ Fr   c                s   \        V \        4      '       d   V # \        V \        4      '       d   V P                  p R V 9   d'   V R ,          p\        V\        4      '       d   RV/V R &   V'       d   R V 9   d   V R ,          pVP                  RR4      pV'       g	   V'       dn   VP                  R4      '       d
   VR,          pV'       d    \        P                  P                  W4      pVP                  R4      pV'       g   RpW0R ,          R&   R V 9   dh   RV R ,          9   dZ   \        XR,          \        4      '       d=   . pVR,          P                  4        F  w  rVVP                  V RV 24       K  	  WBR&   R V 9   dA   R	V R ,          9   d3   \        XR	,          \        4      '       d   \        VR	,          4      VR	&   R FG  pWp9   g   K  \        W,          \        4      '       g   K)  \        P                   ! W,          4      W&   KI  	  R F4  pWp9  d   K  \        W,          \        4      '       g   K)  W,          .W&   K6  	  R
V 9   d;   V R
,          p\#        V4       F"  w  rV
R9   g   K  V
P%                  RR4      W&   K$  	  R F  pWp9  d   K  \'        W,          4      W&   K   	  RV 9   d(   V R,          p\        V\        4      '       d	   RV/pWR&   RV 9   d   V R,          p\        V\        4      '       d   V # \        V\        4      '       d   V/ /pM"\)        V4      '       d   V Uu/ uF  q/ bK  	  ppVP                  4        F  w  rVVP+                  RR4       K  	  WR&   V # u upi )r9   contextrJ   ./r   NNrQ   .additional_contextsr   r   r?  rP   r  r  r  r  rq  rb  rX  )r@  r?  rC  )zseccomp:unconfinedzapparmor:unconfined)r   r   )r   r  r  r   r   rw   r^   r`   rb   rc   r   r   r   rf   r   re  r\   r  r   r   r   Z
setdefault)r  r  r9   r  Znew_additional_contextsr   r   r   Zsec_lsixr   r  rh  r     &&            r   normalize_servicer    s   '8$$';''--' eS!! )51GG7g% ))Ir*g!!$''!"+'',,w8nnS)G*1GY''3ww7GGe12D99&(#34::<'..!AaSz: =+B'('f(88eFmT**(v7E&M(>',,,${{7<8 ) 7glC((#L>GL	 7
  (!&)HBDD!\\#s3
 * )#GL1 ) G)$gs## '*G!(Iw|$dH%%NdC  ":DT]]#'(4arE4D( JJLDALL&78 ! $N )s   6M4c               r   )r   rm   rO   r   r   r   r   r   r   r     s      ~ . r   c                sn    V P                  R/ 4      pVP                  4        F  p\        V4       K  	  V # )zD
convert compose dict of some keys from string or dicts into arrays
r  )rw   r8  r  )rm   r  r  r   r   	normalizer    s2     {{:r*H??$'" %Nr   c               r   )r   r  rO   project_dirr   r   r   r   r   r   r   r     s!     
 
^ 
# 
. 
r   c                sn   R V 9   d   V R ,          p\        V\        4      '       d   TMVP                  RR4      p\        V4      '       g=   \        P
                  P                  \        P
                  P                  W4      4      p\        V R ,          \        4      '       g   / V R &   W0R ,          R&   V # )r9   r  r   )	r   r   rw   is_context_git_urlr`   rb   normpathrc   r   )r  r  r9   r  rK   r   normalize_service_finalr
    s    ' %eS11%uyyC7P!'**gg&&rww||K'IJG''*D11!GG&-#Nr   c               r   )r   rm   rO   r  r   r   r   r   r   r   r   r     s!      ^ # . r   c                sn    V P                  R / 4      pVP                  4        F  p\        W14       K  	  V # )r  )rw   r8  r
  )rm   r  r  r  rK   r   normalize_finalr    s0    {{:r*H??$5 %Nr   c               r   )r   r   r   r   r   r   r   r   r   r   #  s     P P P Pr   c                st    \        V 4      '       g   \        V \        4      '       d   V P                  4       # T # r    )r   r   r   r   r   r   r   cloner  #  s'    "5>>Zt-D-D5::<O%Or   c               $    V ^8  d   QhRRRRRR/# )r   r[   rO   rZ   r   r   r   r   r   r   r   '  s&     C C. C. C^ Cr   c           	     s>   \        4       p\        4       pVP                  4        F+  w  rEW@9   d   K  \        V4      W&   VP                  V4       K-  	  V P                  4        EF  w  rEWB9   d   K  WA9  d   \	        V\
        4      '       d(   \        P                  RV4       VP                  V4       \	        V\        4      '       d.   \        P                  RWE4       \        VP                  4      W&   K  W,          p\	        V\
        4      '       g   \	        V\
        4      '       d   VP                  V4       K  \	        V\        4      '       g   \	        V\        4      '       dF   \	        V\        4      '       d   \        VP                  4      M\        VP                  4      W&   EKN  VR9   d   \        V4      W&   EKe  \	        V\        V4      4      '       g+   \        V4      p\        V4      p\        RV RV RV 24      h\        V4      '       d   VR8X  d   V U	u0 uF%  p	RV	9   g   K  V	P                  R^4      ^,          kK'  	  p
p	\        V4       UU	u. uF0  w  rRV	9   g   K  V	P                  R^4      ^,          V
9   g   K.  VNK2  	  ppp	\        V4       F  pW[ K  	  VP!                  V4       EKb  VP!                  V4       EKv  \	        V\"        4      '       d   \%        WV4       EK  W`V&   EK  	  V F  pW K  	  V # u up	i u up	pi )	z'
update target from source recursively
zUnneeded !reset found for [%s]z1Unneeded !override found for [%s] with value '%s'zcan't merge value of [z
] of type r7  rC  rP   r  )r   r   r  r  r   r  r   r  r  r   rY   r2   r   r\   r  reversedr   r   rec_merge_one)r[   rZ   doneremover   r   Zvalue2Z
value_typeZvalue2_typer   Zptsr  Zdel_lsr  r   r  r  '  s    5DUFlln
=El	 %
 lln
;%**93?

3%--LcY#EKK0eX&&*VX*F*FJJsOe[))Z-L-L&0&D&Dekk"%PVP\P\J] K ++-FK&$u+..eJv,K5cU*ZLPUVaUbcdd6??i39F6aSAX)qwwsAq))6F&/&6&67B#(BqwwsTUWXGY]`G`BB&6   #6*B	 +V$V$%%%( 3Ke %h K  M# Gs   *	L8L%L5LLc               r  )r   r[   rO   sourcesr   r   r   r   r   r   r   m  s!      n  > r   c                s.    V F  p\        W4      pK  	  X# )z(
update target recursively from sources
)r  )r[   r  rZ   r     &*  r   	rec_merger  m  s     F+ Jr   c               r.   )r   	file_pathr   streamr   r   rO   r   r   r   r   r   r   v  s!       S ^ r   c                s    \         P                  ! V4      #   \         P                  P                   dO   p\        P                  R T4       \        P                  RYR7       \        P                  ! ^4        Rp?R# Rp?ii ; i)z"Compose file contains an error:
%sz"Compose file %s contains an error:)Zexc_infoN)	r  Z	safe_loadZscannerZScannerErrorr   r-  r  r.  r/  )r  r  r   r   r   load_yaml_or_dier  v  s]    ~~f%%<<$$ 		7;5yMs    BAB  Bc               s(    V ^8  d   QhRRRRRRRR/# )r   r  rO   service_namesr   rd  r   r/   r   r   r   r   r   r     s,     % %%-6%AO%	%r   c                s   V EFY  pW,          pVP                  R / 4      p\        V\        4      '       d   RV/pVP                  R4      pV'       g   KS  VP                  R4      pV'       d   VP                  R4      '       d
   VR,          p\	        VRRR7      ;_uu_ 4       p\        Wx4      ;'       g    / p	RRR4       R	X	9   d
   V	R	,          p	\        P                  P                  V4      p
\        W4      p	V	P                  V/ 4      ;'       g    / p\        W4       M'V P                  V/ 4      P                  4       pVR
  VR  \        / W4      pWV&   EK\  	  R#   + '       g   i     L; i  \         d     L7i ; i)r  r  r   r  r  rrr   ZencodingNr  r>  )rw   r   r   r^   openr  r`   rb   r   r   r  r   r   r  )r  r  rd  ra   r  r  Zfrom_service_namefilenamefcontentZsubdirectoryZfrom_serviceZnew_services   &&&          r   resolve_extendsr    sR    .kk)R(c3c"CGGI. 776?""4((#B<hg66!*87==2 7W$!*-77??84Lw0G";;'8"=CCLl9#<<(92>CCELW% +  L:$9  76  s   %E#	E6#E36FFc               r
   )r   dotenv_pathr   r   r   r   r   r   r   r   r     s     & & &(= &r   c                sf    \         P                  P                  V 4      '       g   / # \        V 4      # r    )r`   rb   isfiler	   )r   r   r   rc  rc    s%    77>>+&&	%%r   c                  s    ] tR tRt ! R R]4      tR R ltR R ltR R	 ltR R R llt	R R lt
R R ltR R ltR R ltR R ltR R ltR R R lltR R R llt]R R l4       tRtR
# )!rn   i  c                  s.    ] tR tRtRtRtRtRtRtRt	Rt
R	# )
PodmanCompose.XPodmanSettingKeyi  Zdocker_compose_compatr   Zdefault_net_behavior_compatZname_separator_compatin_podpod_argsr   N)rw  rx  ry  rz  DOCKER_COMPOSE_COMPATr   DEFAULT_NET_BEHAVIOR_COMPATNAME_SEPARATOR_COMPATIN_PODPOD_ARGSr}  r   r   r   r   r"    s$     7";&C# 7r   r   c               r  r   r   r/   r   r   r   r   r   PodmanCompose.__annotate__  s     
 
$ 
r   c                	s<   V  R V n         / V n        R V n        / V n        \        P
                  ! 4       V n        R V n        V  V  . V n        R V n	        / V n
        RV n        R V n        V  V  V  \        4       V n        RV n        / V n        V  RV n        . ROV n        R # )Nr   TrJ   )z[1;32mz[1;33mz[1;34mz[1;35mz[1;36m)podman_versionrd  r  commandsargparse	Namespaceglobal_argsru   
containersrv   r  r!  r   r   all_servicesr   r   	yaml_hashconsole_colorsr  r   r   r  ZPodmanCompose.__init__  s    *.')(*#--/(,%'+/	(*'07;&)e(,%DF
r   c               r
   )r   r  rO   r   r/   r   r   r   r   r   r+    s       4 r   c                	s   \        V\        4      '       d   V.p\        T;'       g    . 4      pW P                  ,
          pV'       d@   R P	                  V4      p\
        P                  RV4       \        P                  ! ^4       R# R# )rT   zmissing services [%s]N)	r   r   r   r2  rc   r   r   r.  r/  )r  r  ZgivenmissingZmissing_csvr   r   assert_servicesZPodmanCompose.assert_services  sd    h$$ zHHNN#+++((7+KKK/=HHQK r   c               r
   )r   r  r   r   r   r   r   r   r   r   r+    s      3 9 r   c                	sT   . pV P                   P                   F(  pVP                  \        P                  ! V4      4       K*  	  VR 8w  d   TMRpV P                   P
                  P                  RV R2. 4      pV F(  pVP                  \        P                  ! V4      4       K*  	  V# )r   r:   Zpodman_Z_args)r0  r   r   re  r\   __dict__rw   )r  r  r  r   Zcmd_normr     &&    r   r  ZPodmanCompose.get_podman_args  s    $$00DLLT*+ 1/3u##,,0078*E1JBODLLT*+ r   Nc               r
   )r   argvr  r   r/   r   r   r   r   r   r+    s     $ $. $$ $r   c                	s  "   \         P                  R \        4       V P                  V4      pVP                  pVR8w  d   \
        P                  P                  V4      '       dL   \
        P                  ! V\
        P                  4      '       d!   \
        P                  P                  V4      pM<VP                  RJ d-   \         P                  RV4       \        P                  ! ^4       \        WVP                  \         P"                  ! VP$                  4      4      V n        VP                  '       g    V P&                  P)                  R.R. 4      G Rj  xL
 P+                  R4      P-                  4       ;'       g    RV n        V P.                  P1                  4       ;'       g    R.R,          V n        V P.                  '       g,   \         P                  R4       \        P                  ! ^4       \         P                  R	V P.                  4       VP6                  pVR
8g  ;'       d    VR8g  ;'       g    VP8                  R8g  pV'       d   V P;                  4        V P<                  V,          pV! W4      G Rj  xL
 p\?        V\@        4      '       d   \        P                  ! V4       R# R#  EL_  \2        P4                   d    RT n         ELi ; i LZ5i)zpodman-compose version: %sr   FzBinary %s has not been found.	--versionrJ   Nrr   z0it seems that you do not have `podman` installedzusing podman version: %sversionsystemdcreate-unit)!r   r  __version___parse_argsr  r`   rb   r!  accessZX_OKr   r  r-  r.  r/  r  r  r  parallelr   r   r   r@   r,  r\   r   r   rb  action_parse_compose_filer-  r   r)   )r  r9  r   r  cmd_nameZcompose_requiredr  Zretcode   &&      r   r:   ZPodmanCompose.run  s#    -{;%&&("ww~~k**ryybgg/N/N gg..{; <<5(II={KHHQKTg>O>OPTP]P]>^_|||+-1[[-?-?rSU-V'V&^&^'%''  '  # (,':':'@'@'B'J'JrdB&O# &&&		LMHH/1D1DE<<#y0 
 
	!AAT[[M%A 	 $$&mmH%D'gs##HHW $% (W 00 +&*#+ (sz   A#K"&*K"B(K":!J= J:'J= (J= -J= =K"A"K"2K"?K".K"K 4K":J= =KK"KK"c               r  )r   r   r  r   r   r   r   r   r+    s      * r   c                	s:   V P                   P                  ;'       g5    V P                  P                  \        P
                  P                  R 4      p\        V4      pVR J d   RV P                   2# VRJ d   R# \        V\        4      '       d	   V'       g   Q hV# )TZpod_FN)r0  r#  r   rw   rn   r   r(  r   ru   r   r   )r  Z
in_pod_argZin_pod_arg_parsedr   r   resolve_pod_nameZPodmanCompose.resolve_pod_name  s    
 %%,, 
 
0A0A++22D1

 +:6$$++,--%*c**z99r   c               r  r  r   r   r   r   r   r+  -  s     	
 	
) 	
r   c                	s    V P                   P                  e+   \        P                  ! V P                   P                  4      # V P                  P                  \        P                  P                  RR.4      # )Nz--infra=falsez--share=)	r0  r$  re  r\   r   rw   rn   r   r)  r  r   r   resolve_pod_argsZPodmanCompose.resolve_pod_args-  s^    
 $$0;;t//8899}}  ++44
6S
 	
r   c               r   r   r  r   r   r   r   r   r   r   r+  8  s      c c r   c                	s    V P                   P                  \        P                  P                  R 4      p\        V4      '       d   RpMRpVP                  V4      # )Fr   rt   )r   rw   rn   r   r'  r   rc   )r  r  ZsettingZsepr  r   r   ZPodmanCompose.join_name_parts8  sH    --##M$C$C$Y$Y[`a'""CCxxr   c               r   rI  r   r   r   r   r   r+  @  s     ? ?# ?# ?r   c                	s^    V P                   f   Q hV P                  ! V P                   .VO5!  # r    )ru   r   )r  r  s   &*r   rx   ZPodmanCompose.format_name@  s0      ,,,##D$5$5>>>r   c               r.   )r   rm   rO   rd  zdict[str, str]r   r/   r   r   r   r   r   r+  D  s'     .R .R .R .R\` .Rr   c           	     	s  a  \         P                   Uu/ uF  q3P                  VbK  	  pp/ S n        VP	                  R / 4      P                  4        Fc  w  rVVP	                  V4      pV'       d   VS P                  V&   K/  \        P                  RVRP                  VP                  4       4      4       Ke  	  VP                  4        UU	u/ uFG  w  rVP                  R4      '       g   K  VR
9  g   K'  VP                  R4      P                  4       V	bKI  	  p
pp	V
P                  4        Fc  w  rVVP	                  V4      pV'       d   VS P                  V&   K/  \        P                  RVRP                  VP                  4       4      4       Ke  	  S P                  P	                  \         P                  P                  R4      '       do   R V 3R llpV! \         P                  P                  R4       V! \         P                  P                  R4       V! \         P                  P                   R4       R	# R	# u upi u up	pi )r`  z=unknown x-podman key [%s] in compose file, supported keys: %s, ZPODMAN_COMPOSE_zCunknown PODMAN_COMPOSE_ key [%s] in environment, supported keys: %sFc               r.   )r   r   r"  r   r   r   r/   r   r   r   r   r   Z<PodmanCompose._parse_x_podman_settings.<locals>.__annotate__j  s$     / /,K /TX /]a /r   c                sL   < V SP                   9  d   VSP                   V &   R # R # r    )r   )r   r   r  s   &&r   set_if_not_already_setZFPodmanCompose._parse_x_podman_settings.<locals>.set_if_not_already_setj  s"    dmm+).DMM#& ,r   TN>   ZPODMAN_COMPOSE_PROVIDERZPODMAN_COMPOSE_WARNING_LOGS)rn   r   r   r   rw   r   r   r   rc   r   r^   Zremoveprefixr   r%  r&  r'  r(  )r  rm   rd  r  Z
known_keysr   r   Z	known_keyr   r   r   rK  s   f&&         r   _parse_x_podman_settingsZ&PodmanCompose._parse_x_podman_settingsD  s   *7*I*IJ*IQggqj*I
JKK
B/557DA"q)I+,i(SIIjoo/0 8 &mmo
-
~~/0 ? UU ?C./557>- 	 
 IIKDA"q)I+,i(YIIjoo/0   ==]<<RRTYZZ/ / #//KKT #=#B#B#X#XZ^_"=#B#B#I#I5Q [G K
s   H=I,I5$Ic               r  r*  r   r   r   r   r   r+  t  s     `J `JT `Jr   c           
     	s   V P                   p\        P                  P                  R 4      pV'       d<   \        P                  P                  V4      '       d   \        P                  ! V4       \        P                  P                  R\        P                  4      pVP                  '       gr   \        P                  P                  R4      pV'       d   VP                  V4      pM\        p\        \        \        P                  P                  V4      4      Vn        VP                  pV'       g,   \        P                  R4       \         P"                  ! RN4       \%        R V4      p\'        Wv4       UU	u. uF  w  rV'       d   K  V	NK  	  p
pp	V
'       d-   \        P                  RV
4       \         P"                  ! ^4       TpV^ ,          pVP(                  p\        P                  P+                  \        P                  P-                  V4      4      p\        P                  P/                  V4      pWn        / pVP0                  '       d   RVP0                  8X  d}   \        P                  P+                  \        P                  P3                  VR4      4      p\        P                  P                  V4      '       d   VP5                  \7        V4      4       \        P                  P+                  VP0                  4      pVP5                  \7        V4      4       \        P                  P5                  VP9                  4        UUu/ uF"  w  ppVP;                  R4      '       g   K  VVbK$  	  upp4       VV n        V P                  P5                  \=        \        P                  4      4       V P                  P5                  R VRVP3                  V4      RV/4       V'       dJ   RV9   dC   VP>                  '       d1   \A        VP>                  4      pV P                  P5                  V4       / p\C        V4      p  \E        V4      pTPI                  4       P                  R
4      RN,          R8X  d   \K        T\         PL                  4      pM+\O        TRRR7      ;_uu_ 4       p\K        TT4      pRRR4       \Q        X\<        4      '       g=   \         PR                  PU                  RT,          4       \         P"                  ! ^4       \W        T4      pT'       g|   T P                  P                  R4      pT'       g   TP                  R4      pT'       g   TPY                  4       p\Z        P]                  RT4      pT'       g   \_        RT R24      hTpYn        T P(                  f   Q hT P                  P5                  RT P(                  /4       \a        TT P                  4      p\Q        TP                  R4      ;p\<        4      '       d   TPc                  4        F  p\Q        T\d        4      '       d   K  \Q        T\f        4      '       d   K3  RT9   g   K<  TR,          P                  R4      ;p'       g   K^  \        P                  P3                  \        P                  P-                  T4      T4      TR,          R&   K  	  \i        TT4       TP                  R4      pT'       g   EK  TPk                  T Uu. uF@  p\        P                  P3                  \        P                  P-                  T4      T4      NKB  	  up4       TR EK  u up	pi u uppi   \F         d     Mi ; i  + '       g   i     EL; iu upi T Pm                  TP                  R/ 4      \o        TPp                  4      4      p T TR&   \s        TRR4      '       g   \u        TT P,                  4      p\v        Px                  ! T4      T n=        \|        P~                  ! TROR7      P                  R4      p!\        P                  ! T!4      P                  4       T nD        TTR&   \        T4      ^8  d-   \        P                  R\|        P~                  ! T^R7      4       T P                  TT P                  4       T P                  4       p"TP                  R4      p#T#f   / p#\        P                  R 4       T Pm                  T#\o        TPp                  4      4      p#\        T#R	R!7       \        T#P9                  4        U$U%u. uF  w  p$p%\        T%R",          4      T$3NK  	  Mu up%p$i up%p$4      p&\        T#T& U'U$u. uF  w  p'p$T$NK
  	  Mu up$p'i up$p'T P                  4       \        T#4       TP                  R#/ 4      p(T('       g   RT(R$&   T(T nM        T P                  P                  \        P                  P                  R%4      '       d"   R$T P                  9  d   RT P                  R$&   MV\        T P                  4      ^8X  d'   \        T(P                  4       4      ^ ,          T nS        MR$T(9   d	   R$T nS        MRT nS        \o        4       p)T#P9                  4        Fm  w  p$p%T%P                  R#T P                  4      p*\Q        T*\<        4      '       d   \        T*P                  4       4      M
\        T*4      p*T)P5                  T*4       Ko  	  \o        T(P                  4       4      p+T)T+,
          p,T+T),
          \o        R$.4      ,
          p-\        T-4      '       d(   RP3                  T-4      p.\        P                  R&T.4       \        T,4      '       d    RP3                  T,4      p/\_        R'T/ 24      hTP                  R(/ 4      T nU        R)T P                  ,           R*T,           R+\        ,           R,T R-2R.T,           R/T,           R0RP3                  T4      ,           .p0TP                  R1/ 4      T nW        . p1/ p2T#T nX        T#P9                  4        EF  w  p3p4^p5R2T9   dM   TP                  e?   TP                  P                  R34      p6T3T6^ ,          8X  d   \        T6^,          ^R47      p5MR2T49   d   \        T4P                  R24      ^R47      p5MqR5T49   dk   R6T4P                  R5/ 4      9   dT   R7T4P                  R5/ 4      P                  R8R4      8X  d-   \        T4P                  R5/ 4      P                  R64      ^R47      p5. T2T3&   \        ^T5^,           4       EF  p7T P                  T3\        T74      4      p8T7^8X  d   T4P                  R9T84      p$MT8p$T2T3,          P                  T$4       R:T"RT$R;T7R<T3/T4Cp9T4P                  R=4      p:T:RJ;'       d    T:P                  R>4      RJp;R?T99  d   T;'       g   T P                  T34      T9R?&   \        T9P                  R@4      4      p<\        T9P                  RA4      4      T9RA&   T<Pk                  T04       T<Pk                  RBT7 2RCT3 2RDT3 2.4       T<T9R@&   T3T9RE&   TT9RF&   T1P                  T94       T9P                  R(. 4      p=T= Fi  p>\        T T9T>4      p?T?P                  RG4      RH8X  g   K(  T?RI,          '       g   K9  T?RI,          T P                  9  g   KS  T?RI,          p@\_        RJT@ RK24      h	  EK  	  EK  	  T2T na        \o        T2P                  4       4      T nb        T1 UAu/ uF  pATAR,          TAbK  	  Mu upAi pBpA\        TBPc                  4       4      p1T1P                  RL RM7       T"'       d   RT"/.M. T nd        T1T ne        T1 UAu/ uF  pATAR,          TAbK  	  Mu upAi upAT nf        R# )PZCOMPOSE_PROJECT_DIRZCOMPOSE_PATH_SEPARATORZCOMPOSE_FILEz[no compose.yaml, docker-compose.yml or container-compose.yml file found, pass files with -fc                sZ    V R 8H  ;'       g     \         P                  P                  V 4      # )r   )r`   rb   r   )r  r   r   r"   3PodmanCompose._parse_compose_file.<locals>.<lambda>  s     1888rww~~a'88r   zmissing files: %s.envPODMAN_r   TrQ   r   r  rr   r  Nz5Compose file does not contain a top level object: %s
ZCOMPOSE_PROJECT_NAMEra   rJ   zProject name [z] normalized to emptyr  r  r   includeZno_normalizerT   )Z
separatorsZ_dirnamez ** merged:
%s)ZindentzWARNING: No services defined)r  r>  r  r   FzWARNING: unused networks: %szmissing networks: rC  zio.podman.compose.config-hash=r   zio.podman.compose.version=z#PODMAN_SYSTEMD_UNIT=podman-compose@z.servicer   z'com.docker.compose.project.working_dir=z(com.docker.compose.project.config_files=rE  scaler   )r(   r   replicasZ
replicatedr   container_namer=  numr&  r`  rm  ra  r   rH  z$com.docker.compose.container-number=zio.podman.compose.service=zcom.docker.compose.service=r   Z_projectrY   rS   rZ   zvolume [z] not defined in top levelc                s8    \        V P                  R . 4      4      # r>  )r]   rw   )rj  r   r   r"   rM  	  s    Cgr0B,Cr   )r   r>  )rT   rP   )gr0  r`   rd  rw   rb   ZisdirZchdirpathsepr   r\   COMPOSE_DEFAULT_LSr#   r$   r   r   r-  r.  r/  r  zipru   r   r   basenamer@  rc   r   rc  r   r^   r   r   r   ZiternextZStopIterationr@   r  Zstdinr  r   r  writer  r   norm_rer   r   r   r8  r  r  r  r   _resolve_profilesr   profilegetattrr  r  Z	safe_dumpmerged_yamlrf  rg  r{   ry   rz   r|   r3  r]   r   rL  rG  r   r  Zsortedr  r  r   rn   r   r&  r   r!  r   rv   r?  r   r  rQ  r-   r  rx   r   rf   r  r   r,  r2  Zsortpodsr1  container_by_name)Cr  r   r  rV  Zdefault_strZ
default_lsZfilesZexZex0Zfn0r5  Zrelative_filesr  ru   r   Zdir_basenamerk  Zproject_dotenv_filer   r   r   Zenv_varsrm   Z
files_iterr  r  Zproject_name_normalizedZcontent_servicesr  Zservice_filerP  r!   Zresolved_servicesZmerged_json_bZpod_namer  ra   r  r  rt   ZnetsZallnetsZsrv_netsZ
given_netsZmissing_netsZunused_netsZunused_nets_strZmissing_nets_strZpodman_compose_labelsZgiven_containersr,  r&  Zservice_descrR  Z
scale_argsrT  name0r   r   rl  r   rC  rS   Zmnt_dictr   rj  rb  sC   &                                                                  r   rD  Z!PodmanCompose._parse_compose_filet  s   jjnn%:;277==55HH[!**..!92::Fyyy**..8K(..w7
/
VBGGNNJ?@DI		II% HHRL8%@'*2~A~83S33~AII)73HHQK8((
 ww''(ABww''0 === &&(gg&6&6rww||GV7T&U#77>>"566&&~6I'JK''**4==9K~k:;


)//1
1
U~~i( CJ1
 	
 #D,- 	!7GLL8$g
 	 ETMdhhh#DHH-HLL)"$%[

+ ~~%%c*2.#5*8SYY?(C'::a.x;G ; gt,,

  LxW (G
  #||//0FG##*;;v#6L##/#5#5#7L +2++b,*G'.&~EZ'[\\6 ,$$000LL!79J9J KLw5Ggkk*.EE*tLL/668G%g{;;JwX`DaDa$/,3I,>,B,B6,JJLJJ9; " 9<:GI.v6  9 gw'kk),GwRYZRYQbggll277??8+DaHRYZ[ I&_ B8
4 !  ;::Z [ !227;;z23NPSTXT`T`Pab/
t^T22%gt||<G>>'2

7zBII'R 6@@B%
u:>II'GA)FG 	%%gt||<((* 'J 7HKK67))(C4EF 	(.8>>K[\K[idCS\!2D 9K[\]}"E}GAt4}"Et||T({{:r*"DO==]<<XXZ_``
 -+/i(4==!Q&#'		#4Q#7 d"#, #' %!)ID#wwz4+;+;<H)3Hd)C)CX]]_%V^I_  NN8$ * %
+ 7*S)-=={!hh{3OKK6H|"xx5!34D3EFGGKK	2.	,t~~=(<7(;61,xH)L85?6.9QQ!
 !(Ir :;=" *2..*:&L,H$4::#9!ZZ--c2
:a=0&z!}qAHL("<#3#3G#<qIL(,"2"28R"@@ L$4$4Xr$B$F$Fvr$RR #<#3#3Hb#A#E#Ej#Q\]^79&|4Q1-((s3x@!8'++,<eDD D*<8??E 8D3"L	
 # (++J7&d2YYx||H7MUY7Y#%k#'#3#3L#ACL%cggh&78)#'''*:;G34:3%@0?1,@ 
 !'H".J".J '','')R0%F+D#v>H V,8$X..$X.dii?#+H#5*XhZ?Y+Z[[ &A .) +;z +E' : ? ? AB3CD3CaQvY\3CDD 1 8 8 :;"CD -5fh'("	*8H!I8H1!F)Q,8H!IsU   :]"]"](
1](
	]. 0]?A^.]<;]<?^		 e*
f}!3c               r   )r   defined_servicesrO   requested_profileszset[str] | Noner   r   r   r   r   r   r+  	  s$       .DS	r   c                s    Vf   \        4       p/ pVP                  4        FE  w  rE\        VP                  R. 4      4      pV'       d   VP                  V4      '       g   KA  WSV&   KG  	  V# )a  
Returns a service dictionary (key = service name, value = service config) compatible with
the requested_profiles list.

The returned service dictionary contains all services which do not include/reference a
profile in addition to services that match the requested_profiles.

:param defined_services: The service dictionary
:param requested_profiles: The profiles requested using the --profile arg.
Zprofiles)r   r   rw   Zintersection)r  rd  re  r  ra   r  Zservice_profiless   &&&    r   r]  ZPodmanCompose._resolve_profiles	  se     %!$,224LD"6::j"#=>#'9'F'FGW'X'X!' 5 r   c               r
   )r   r9  r  r   argparse.Namespacer   r   r   r   r   r+  	  s         0  <N  r   c                	sF   \         P                  ! \         P                  R 7      pV P                  V4       VP	                  RRR7      pVP                  RRR7      pV P                  P                  4        FG  w  rVVP                  WVP                  VP                  R7      pVP                   F  pV! V4       K  	  KI  	  VP                  V4      V n        V P                  P                  '       d   RV P                  n        V P                  P                  '       d   V P                  P                  R8X  d'   VP                  4        \         P"                  ! R4       \$        P&                  ! V P                  P(                  '       d   RMR	R
7       V P                  # ))Zformatter_classrb  )ZtitleZdesthelpz	show help)rg  )rg  Zdescriptionr;  ZDEBUGZWARN)Zlevelr>  )r.  ZArgumentParserZRawTextHelpFormatter_init_global_parserZadd_subparsersZ
add_parserr-  r   rg  descr@  Z
parse_argsr0  r;  rb  Z
print_helpr.  r/  rD  ZbasicConfigZverbose)	r  r9  parserZ
subparsersrt   rE  r  Z	subparserZ
cmd_parser	   &&       r   r@  ZPodmanCompose._parse_args	  s=   ((9V9VW  (***K
!!&{!;!]]002MH"--hXXSVS[S[-\I!oo
9% . 3 ",,T2###'0D$'''4+;+;+C+Cv+MHHRLd.>.>.F.F.F7FTr   c               r
   r   rj  zargparse.ArgumentParserr   r/   r   r   r   r   r   r+  	  s     ]
 ]
$; ]
 ]
r   c           	     	s6   V P                  R RRRR7       V P                  RRR\        RR	7       V P                  R
RR\        RR	7       V P                  RRR\        RR	7       V P                  RRRRR. R7       V P                  RRRR. R7       V P                  RRR\        RR7       V P                  RR\        R R7       V P                  R!R"R#R. R7       \         F!  pV P                  R$V R%2R&V R'2R#R. R7       K#  	  V P                  R(R)RR7       V P                  R*R+RR7       V P                  R,R-RR7       V P                  R.\        \        P
                  P                  R/\        P                  4      R07       V P                  R1R2RR7       R# )3r   r:  show version
store_truerg  rC  z--in-podzSpecify pod usage:
  'true'   - create/use a pod named pod_<project name>
  'false'  - do not use a pod
  '<name>' - create/use a custom pod with the given namer#  N)rg  metavarrY   r   z
--pod-argsz-custom arguments to be passed to `podman pod`r$  z
--env-filez%Specify an alternate environment filer@  rN  -fz--filezPSpecify an compose file (default: docker-compose.yml) or '-' to read from stdin.r   rf   )rg  rp  rC  r   z	--profilezSpecify a profile to enabler^  rI  z--project-namez;Specify an alternate project name (default: directory name)rg  rY   r   z--podman-pathzMSpecify an alternate path to podman (default: use location in $PATH variable)r   z--podman-argsz0custom global arguments to be passed to `podman`r   z	--podman-z-argsz)custom arguments to be passed to `podman Z`z	--no-ansiz$Do not print ANSI control charactersz--no-cleanupz0Do not stop and remove existing pod & containersz	--dry-runz+No action; perform a simulation of commandsz
--parallelZCOMPOSE_PARALLEL_LIMIT)rY   r   z	--verbosezPrint debugging output)	add_argumentr   PODMAN_CMDSr)   r`   rd  rw   r.  r  )rj  Z
podman_cmdrE   r   rh  Z!PodmanCompose._init_global_parser	  s'   D+N<XK
  	 	
 	@ 	 	
 	8 	 	
 	c 	 	
 	. 	 	
 	N 	 	
 	`	 	 	
 	C 	 	
 &JJ<u-@AN    & 	7 	 	

 	C 	 	

 	> 	 	

 	sBJJNN;SUXU`U`,a 	 	
 	) 	 	
r   )r2  r-  r4  rb  r,  r1  r   r!  r   rd  r  r0  r`  r  r   r,  ra  r   ru   r  rv   r   r3  r    )rw  rx  ry  rz  r   r   r  r6  r  r:   rG  rH  r   rx   rL  rD  r]  r@  Zstaticmethodrh  r}  r   r   r   rn   rn     sf    D 
>$L$	
?.R``JD	0 ( ]
 ]
r   rn   c                  s    ] tR tRtRtR# )PodmanComposeErrori)
  r   N)rw  rx  ry  rz  r}  r   r   r   ru  ru  )
  s    r   ru  c                  s2    ] tR tRtRR R lltR R ltRtR# )	cmd_runi-
  Nc               r   )	r   rm   rn   rE  r   cmd_descr  r   r/   r   r   r   r   r   cmd_run.__annotate__.
  s)     ! ! ! !
 !^b !r   c                	s*    Wn         W n        W0n        R # r    )rm   rE  rw  )r  rm   rE  rw  s   &&&&r   r  Zcmd_run.__init__.
  s      r   c               r   r   funcr   r   r   r   r   r   r   rx  3
  s      X ( r   c                	s  a R  V3R llp\         P                  ! S4      '       g   \        R4      hV P                  Vn        V P
                  ;'       g-    \        P                  ! RRSP                  ;'       g    R4      pRV9   d!   VP                  R^4      w  Vn
        Vn        MW2n
        RVn        . Vn        W P                  P                  V P                  &   V# )c               r  r   r   r   kwr   r   r   r   r   r   Z&cmd_run.__call__.<locals>.__annotate__4
  !     	% 	%3 	%c 	%c 	%r   c                    < S! V / VB # r    r   r   r|  rz     *,r   wrappedZ!cmd_run.__call__.<locals>.wrapped4
      $$$r   zCommand must be asyncz^\s+rJ   r  N)r  Ziscoroutinefunctionru  rm   Z_composerw  rer   Z__doc__r\   rg  ri  r@  r-  rE  )r  rz  r  Z	help_desc   &f  r   __call__Zcmd_run.__call__3
  s    	% 	% **400$%<==<<MMLLRVVGR9K9K%L	9)2q)A&GL',$LGL /6dmm,r   )rw  rE  rm   r    rw  rx  ry  rz  r  r  r}  r   r   r   rv  rv  -
  s    !
 r   rv  c                  s.    ] tR tRtR R ltR R ltRtR# )	cmd_parseiF
  c               r.   )r   rm   rn   	cmd_nameszlist[str] | strr   r/   r   r   r   r   r   cmd_parse.__annotate__G
  s&     J J J/ Jd Jr   c                	sT    Wn         \        V4      '       d	   W n        R # V.V n        R # r    )rm   r   r  )r  rm   r  r  r   r  Zcmd_parse.__init__G
  s    &-i&8&8ykr   c               r   ry  r   r   r   r   r   r  K
  s      X ( r   c                	s   a R  V3R llpV P                    F9  pV P                  P                  V,          P                  P	                  V4       K;  	  V# )c               r  r{  r   r   r   r   r   Z(cmd_parse.__call__.<locals>.__annotate__L
  r}  r   c                 r~  r    r   r  r  r   r  Z#cmd_parse.__call__.<locals>.wrappedL
  r  r   )r  rm   r-  r@  rf   )r  rz  r  rE  r  r   r  Zcmd_parse.__call__K
  sE    	% 	% HLL!!(+77>>wG 'r   )r  rm   Nr  r   r   r   r  r  F
  s    J r   r  r;  rm  c               r.   r   rm   rn   r   rf  r   r/   r   r   r   r   r   r   Z
  s"     	4 	4= 	48J 	4t 	4r   c                s<  "   \        VR R4      '       d   \        \        4       R# \        VRR4      R8X  d*   R\        /p\        \        P                  ! V4      4       R# \        R\        4       V P
                  P                  R.R	. 4      G Rj  xL
  R#  L5i)
ZshortFNr   prettyrf  r;  zpodman-compose versionr:  rJ   )r_  r  r?  rf  rg  r   r:   )rm   r   r  r   r   compose_versionr  Y
  sv     tWe$$ktXx(F2+&djjo	
"K0
..

k]B
333s   BBBBc               r
   )r   	containerr   r   r   r   r   r   r   r   r   f
  s     	 	 	 	r   c                sX    RV 9   d   RV R,          9  # V R,          P                  R4      # )zqTest if a container is local, i.e. if it is
* prefixed with localhost/
* has a build section and is not prefixed
r9   rQ   ra  z
localhost/)r^   )r  r   r   is_localr  f
  s:     i 	9W%% w**<8r   r  zwait running containers to stopc               r.   r  r   r   r   r   r   r   s
  s&     . ..
. 
.r   c                s   "   V P                    Uu. uF  q"R ,          NK  	  ppR.pVP                  V4       V P                  P                  . RV4       R# u upi 5i)ra   z--r  N)r1  r   r   r  )rm   r   r   r1  r  r   r   compose_waitr  r
  sU     
 *1););<);#f++);J<vHOOJNNFH- =s   AA:Ar<  c               r.   r  r   r   r   r   r   r   ~
  s,     eC eC= eC8J eCt eCr   c                s  "   RpVP                   R8X  Edg   V P                  p\        P                  P	                  RV RV R24      p\        P
                  ! \        P                  P                  V4      RR7       \        P                  RV4       \        VR	R
R7      ;_uu_ 4       pV P                  P                  4        FL  w  rgVP                  R4      '       g   VP                  R4      '       g   K5  VP                  V RV R24       KN  	  RRR4       \        P                  RV4       \        P                  R4       \        P                   ! 4       p\#        RV RV RV RV RV RV R24       R# VP                   R8X  d   V P                  p\        P                  P	                  RV RV R24      p\        P                  P%                  V4      '       dX    \        P                  RV4       \        P&                  ! V4       \        P                  RV4       \#        RV RV R24       R# \        P1                  R"V4       \#        R#V R$24       R# VP                   R/9   dn   \2        P2                  ! \        P                  P	                  RV R%24      4      p
V
 F.  p\#        \        P                  P5                  VRR0 4      4       K0  	  R# VP                   R&8X  d   R'pR(V R)V R*\6         R+\6         R,2	p\        P8                  ! \        P                  P                  V4      \        P:                  4      '       dj   \        P                  RV4       \        VR	R
R7      ;_uu_ 4       pVP                  V4       RRR4       \        P                  RV4       \#        R-4       R# \#        V4       \        P1                  R.V4       R# R#   + '       g   i     EL; i  \(         dG   p	\        P+                  RYI4       \#        R T R!24       \,        P.                  ! ^4        Rp	?	R# Rp	?	ii ; i  + '       g   i     L; i5i)1a+  
create systemd unit file and register its compose stacks

When first installed type `sudo podman-compose systemd -a create-unit`
later you can add a compose stack by running `podman-compose systemd -a register`
then you can start/stop your stack with `systemctl --user start podman-compose@<PROJ>`
z#.config/containers/compose/projectsregisterz~/rQ   rN  Tr   zwriting [%s]: ...Zwrr   r  ZCOMPOSE_rO  r   r  Nzwriting [%s]: done.z-

creating the pod without starting it: ...

z
you can use systemd commands like enable, start, stop, status, cat
all without `sudo` like this:

		systemctl --user enable --now 'podman-compose@z,'
		systemctl --user status 'podman-compose@z+'
		journalctl --user -xeu 'podman-compose@z}'

and for that to work outside a session
you might need to run the following command *once*

		sudo loginctl enable-linger 'zN'

you can use podman commands like:

		podman pod ps
		podman pod stats 'pod_z&'
		podman pod logs --tail=10 -f 'pod_z'

unregisterzremoving [%s]: ...zremoving [%s]: done.z

project 'zz' successfully unregistered

you can stop and disable the service with:

		systemctl --user disable --now 'podman-compose@zfailed to remove file %s: %sz0Failed to remove registration file for project 'Z'zregistration file not found: %sz	Project 'z' is not registeredz/*.envr=  z)/etc/systemd/user/podman-compose@.servicez# z`

[Unit]
Description=%i rootless pod (podman-compose)

[Service]
Type=simple
EnvironmentFile=%h/z/%i.env
ExecStartPre=-zG up --no-start
ExecStartPre=/usr/bin/podman pod start pod_%i
ExecStart=zR wait
ExecStop=/usr/bin/podman pod stop pod_%i

[Install]
WantedBy=default.target
zA
while in your project type `podman-compose systemd -a register`
z#Could not write to [%s], use 'sudo')r#   r  i)rC  ru   r`   rb   rd   r   r   r   r   r  rd  r   r^   r[  r  getpassZgetuserr  r   r  r   errorr.  r/  r   globrY  scriptrA  ZW_OK)rm   r   Z
stacks_dirr  Zfnr  r   r   usernamer   r  r!   Zoutr  r   compose_systemdr  }
  s     7J{{j ((	WW"ZL)D AB
BGGOOB'$7		%r*"cG,,--/<<
++q||I/F/FGGqc1#RL) 0 - 			',DE??$3 4=+ >--6K 8,,5; 7"
 #+ ,
 %+ &''0k 2#	
* 
	$((	WW"ZL)D AB77>>"		.3		"		0"5

 4 5>; ? KK92>Ii[(;<=		&YYrww))Bzl&*ABCA"''""1Sb6*+ 		%8$  <  h ( " 99RWW__R("''22II)2.b#00A 1II+R0 #JKK=rB? 
&q -,,Z  		8"@HSTUV@ 10sq   B(Q*AO!:O!CQ&AO5 :DQ,Q?Q	AQ!O2	,	Q5Q ;Q;QQQ	Q	Qzpull stack imagesc               r.   r  r   r   r   r   r   r   
  s'     
Y 
Y 
Y5G 
YD 
Yr   c           
     s`  "   V P                    Uu. uF  pR V9   g   K  VNK  	  ppVP                  '       d6   \        VP                  4      pV Uu. uF  q"R,          V9   g   K  VNK  	  ppV Uu0 uF  q"R ,          kK  	  ppVP                  '       g4   V Uu0 uF  p\	        V4      '       g   K  VR ,          kK!  	  ppWV,          p\
        P                  ! V Uu. uF   qpP                  P                  . RV.4      NK"  	  up!  G Rj  xL
  R# u upi u upi u upi u upi u upi  L5i)ra  r   r7   N)	r1  r  r   Zforce_localr  r  gatherr   r:   )rm   r   r   img_containersr  imagesZlocal_imagesra  rF  r   compose_pullr  
  s     %,%7%7J%7c7c>cc%7NJ}}}t}}%)7W#z?h;V##W&45ns'llnF50>P(3-GP
..PVWPVu>>--b&5'BPVW
XXX K X5P XXs\   D.	DD-D.D&D,D.2DD.D"3D" D.&D'D.D, D.zpush stack imagesc               r.   r   rm   rn   r   rf  r   r0   r   r   r   r   r   r   
  s"       5G J r   c                s$  "   \        VP                  4      p^ pV P                   Fb  pRV9  d   K  V'       d   VR,          V9  d   K$  V P                  P	                  . RVR,          .4      G Rj  xL
 pVf   KW  V^ 8w  g   K`  TpKd  	  V#  L5i)r    r9   r   r8   ra  N)r   r  r1  r   r:   )rm   r   r  statusr   r  r8  r   compose_pushr  
  s     4==!HF!!#Jx7..$$R#g,@@=Q!VF " M As"   7B8B2B3B=B	Bc               r
   )r   rb   r   r   r   r   r   r   r   r   r     s      S T r   c                s   \         P                  P                  V 4      pVP                  R9   d   R# VP                  R8w  d%   VP                  R8X  d   VP
                  R8w  d   R# VP                  R8X  dH   \         P                  P                  RV ,           4      pVP                  e   VP                  R8w  d   R# R# )gitTrJ   zssh://F)r  ZhttpZhttpssshr   Zrsync)urllibZparseZurlparseZschemeZnetlocrb   r  )rb   r  rE   r   r  r    s    d#AxxCCxx2~!((b.QVVr\xx2~LL!!(T/2::!ajjB&6r   c               r&   )r   rm   rn   agent_or_keyr   r   r   r   r   r   r   r     s!     < < <S <S <r   c                s    VP                  R ^4      p\        V4      ^8X  d   V# Vw  r4\        P                  P	                  V4      pVR ,           \        P                  P                  V P                  V4      ,           # )r   )r\   r]   r`   rb   rd   rc   r   )rm   r  r  ra   rb   r   r   adjust_build_ssh_key_pathsr    sb    sA&E
5zQJD77d#D#:W__d;;;r   c               r  )r   rm   rn   r   rO   r   rf  path_existszCallable[[str], bool]cleanup_callbackszlist[Callable] | Noner   r   r   r   r   r   r   r     sL     c cc	c c '	c
 -c cr   c           
     sx	  a VR ,          p\        VR4      '       g   RV/pVP                  RR4      pVP                  RR4      oVP                  R4      pVe   \        V4      pS'       d   V'       d   \        R4      h\        P
                  ! R	R
R7      oSP                  VP                  4       4       SP                  4        SP                  oR V3R llpVe   VP                  V4       . p	\        V4      '       g   R	p
S'       d$   \        P                  P                  VS4      oRp
M=. R-OpV F3  o\        P                  P                  VS4      oV! S4      '       g   K3   M	  V! S4      '       dR   \        P                  P                  \        P                  P                  VS4      4      oV	P!                  RS.4       M$V
'       d   \        RS 24      h\        RV 24      hV	P!                  RVR,          .4       RV9   d   V	P!                  RVR,          .4       VP                  R. 4       F   pV	P!                  \#        WVRR7      4       K"  	  VP                  R. 4       F  pV	P!                  RV.4       K  	  VP                  R. 4      p\%        V\&        4      '       d*   VP)                  4        UUu. uF  w  ppV RV 2NK  	  pppV F  pV	P!                  RV.4       K  	  VP                  R/ 4       F  pV	P!                  RV 2.4       K  	  RV9   d   V	P!                  RVR,          .4       \+        VP                  R/ 4      4       F"  p\-        V V4      pV	P!                  R V.4       K$  	  \/        W4       \1        VR!R4      '       d   V	P                  R"4       \1        VR#R4      '       d   V	P                  R$4       M$\1        VR%R4      '       d   V	P                  R&4       \+        VP                  R'/ 4      4      pVVP2                  ,            F  pV	P!                  R(V34       K  	  VP                  R). 4       F  pV	P!                  R*V.4       K  	  VP                  R+. 4       F  pV	P!                  R,V.4       K  	  V	P                  V4       V	# u uppi ).r9   r   r  r   
dockerfilerJ   dockerfile_inlineNz=dockerfile_inline and dockerfile can't be used simultaneouslyFz.containerfile)ZdeleteZsuffixc               r  r*  r   r   r   r   r   Z-container_to_build_args.<locals>.__annotate__2  s     	& 	&t 	&r   c                 s   < \         P                  P                  S 4      '       d   \         P                  ! S 4       R # R # r    )r`   rb   r   r  )r     r   cleanup_temp_dockfileZ6container_to_build_args.<locals>.cleanup_temp_dockfile2  s'    ww~~j))		*% *r   Trq  zDockerfile not found in -tra  rZ  r[  rE  )r   Ztagsr   r   r   r  z--build-context=r[   z--targetr  z--sshno_cache
--no-cacheZpull_always--pull-alwaysr7   rV  r   --build-argZ
cache_fromz--cache-fromZcache_toz
--cache-to)ZContainerfileZContainerFileZcontainerfileZ
DockerfileZ
DockerFiler  )r   rw   r   r   tempfileZNamedTemporaryFiler[  r{   Zclosera   rf   r  r`   rb   rc   r	  r   r   r   r   r   r   r  r   r_  	build_arg)rm   r   r   r  r  Z
build_descZctxr  r  
build_argsZcustom_dockerfile_givenZdockerfile_altsr   Ztagr   r   r   ZlabelZadditional_ctxr  Z	args_listr  Z	cache_imgr  s   &&&&&                  @r   container_to_build_argsr    s5    WJ:w'',

..C
(Cb1J"':;$ 12+YZZ00FVW
*1134__
	& 	& ($$%:;Jc"""'c:6J&*#O .
WW\\#z:
z** .
 z""))"'',,sJ*GHJtZ01& 8EFF4SE:;;tS\*+S<Z9:..B//'SWXY 0~~fb)4+& *^^Hb)F&$+1<<>:>!QQCq*>:9e,- $..)>C-n-=>?@ D::z(';<=$Z^^E2%>?1'<H7L12 @ #33tZ&&,'t]D))/*	vt	$	$(#Z^^FB78I//	
 	 0
  ^^L"5	>956 6^^J3	<34 4c9 ;s   	R6c               r   )	r   rm   rn   r   rf  r   r   r   r0   r   r   r   r   r   r     s*      ] 2D 4 T^ r   c           
     s  "   R V9  d   R# \        VRR4      '       d=    V P                  P                  . RRRRRVR,          .4      G Rj  xL
 pV'       d   R# . p\        WV\        P                  P                  VR7      pV P                  P                  . R V4      G Rj  xL
 pV F
  pV! 4        K  	  V#  Ln  \        P                   d    Rp Li ; i L55i)	r9   Nif_not_existsr   r  ra  rq  z{{.Id}})r  )
r_  r   r   r   r   r  r`   rb   r   r:   )rm   r   r   Zimg_idr  r  r  rj  r~   r   	build_oner    s     ct_d++	">>00IgtYGM F
 (*(dBGGNN>OJ >>%%b':>>F	 M ,, 	F	 ?sM   C,B= B;B= CAC$C%C;B= =CCCCzbuild stack imagesc               r.   )r   rm   rn   r   rf  r   r)   r   r   r   r   r   r     s"       6H S r   c           
     sF  "   . pVP                   '       d   V P                  pV P                  VP                   4       VP                    FR  pV P                  W4,          ^ ,          ,          pVP	                  \
        P                  ! \        WV4      4      4       KT  	  MBV P                   F2  pVP	                  \
        P                  ! \        WV4      4      4       K4  	  ^ p\
        P                  ! V4       F  pVG Rj  xL
 pVf   K  V^ 8w  g   K  TpK   	  V#  L5ir  )
r  r,  r6  rb  rf   r  r  r  r1  Zas_completed)	rm   r   tasksr,  r  r   r  tr  rk  r   compose_buildr    s     E}}}%,%G%G".}}G++,F,OPQ,RSCLL,,Ywc-JKL %
 %%CLL,,Ywc-JKL & F!!%(G=Q!VF )
 M	 s   DD!DD!D!	D!c               r.   )r   rm   rn   ra   r   r   r   r   r   r   r   r   r     s!      m 3 4 r   c                sf   "   V P                   P                  . R RV.4      G Rj  xL
 pV^ 8H  #  L	5i)r=  r   N)r   r:   )rm   ra   r  r   r   
pod_existsr    s5     nn((UXt4DEEI> Fs   #1/
1c               r
   )r   rm   rn   r   r/   r   r   r   r   r   r     s     9 9} 9 9r   c                s  "   V P                    F  p\        WR ,          4      G Rj  xL
 '       d   K%  RRVR ,          ,           .V P                  4       ,           pVP                  R. 4      p\	        V\
        4      '       d   V.pV F  pVP                  R\        V4      .4       K!  	  V P                  P                  . RV4      G Rj  xL
  K  	  R#  L L5i)ra   Nr   r;  rH  rI  r=  )	ra  r  rH  rw   r   r   r   r   r:   )rm   r=  r   rH  r!   s   &    r   create_podsr    s     ||G[111 F#
 $$&'
 $eS!!GEAc!f~. nn  UK888 1 	9s'   %CC	CBCCCCc               r.   )r   rm   rn   r   rf  r   zset[str]r   r   r   r   r   r     s"     
 
- 
/A 
h 
r   c                s   \        4       pVP                  '       d   \        V P                  4      pVP                   Fh  pW0P                  9   dE   \        VR R4      '       g2   V\        R V P                  V,          R,           4       4      ,          pVP                  V4       Kj  	  \        P                  RV4       V# )r:  Fc              3  s8   "   T F  qP                   x  K  	  R # 5ir    r  )r  r  rE   r   r  Zget_excluded.<locals>.<genexpr>  s     S0R10Rs   r>  z** excluding: %s)r   r  r_  r  r   r   )rm   r   excludedr  rK   r   get_excludedr    s    uH}}}w''(}}G***74E3R3RCS0@0@0I'0RSSSW%	 %
 II (+Or   c               r.   )r   rm   rn   rh  r   r   r/   r   r   r   r   r   r     s!     1' 1' 1'S 1'T 1'r   c                st  "   V'       g   R# \          EFU  p. pV F  pVP                  V8X  g   K  VP                  \         P                  \         P                  39   dc   V P                  eU   \        V P                  R4      '       d9   \        P                  RVP                  V P                  VP                  4       K  VP                  V P                  VP                  ,          4       K  	  V'       g   K    V P                  P                  . RRVP                   2.V,           4      G Rj  xL
  \        P                  RVP                  RP                  V4      4       EKX  	  R#  L;  \         P"                   d   p\%        TP&                  ;'       g    RTP(                  ;'       g    R,           P+                  4       P-                  R	4      4      p\        P                  R
TP.                  TP0                  T4        Rp?MRp?ii ; i\2        P4                  ! ^4      G Rj  xL 
  EK<  5i)z5Enforce that all specified conditions in deps are metNz4.6.0z?Ignored %s condition check due to podman %s doesn't support %s!r  z--condition=zBdependencies for condition %s have been fulfilled on containers %srJ  r   r  z:Podman wait returned an error (%d) when executing "%s": %s)ro  r  rr  r{  r,  rL   r   r   ra   r   r   r,  r   r   r   rc   r   r   r#   r  r  r   r\   r  r  r  sleep)rm   rh  r  Zdeps_cdZdZ_excr      &&     r   check_dep_conditionsr    s    //	A{{i'KK2::<V<`<`ab **6%g&<&<gFFKKY..!	 wAA!&&IJ# & 7!..//F|IOO3D%E$F$P   II\!		'*
 C 02 "44 	!++,,1C1CDLLNTTUYZF IIT	 		 mmA&&&s`   *H8CH8<H8>5E13E/44E1(H8/E11H,H3AH	H8HH8/H20H8c               r  )r   rm   rn   ra   r   rh  r   rb  r  r  r  r   r0   r   r   r   r   r   r     sD     K KK"%K-0K;@KQ[KKr   c                s   "   RV9   d*   \         P                  RV4       \        W4      G Rj  xL
  \         P                  RV4       V P                  P                  ! VRV/ G Rj  xL
 #  L> L5i)zCruns a container after waiting for its dependencies to be fulfilledr;   z1Checking dependencies prior to container %s startNzStarting task for container %sr  )r   r   r  r   r:   )rm   ra   rh  rb  r  r  r   run_containerr    se      '		EtL"7111 II.5##WJMJJJ	 	2 Ks!   ,A1A-9A1(A/)A1/A1c               r.   )r   r   rf  r   r   r   r   r   r   r   r   r   r     s"      0 t  r   c                sL    V P                   '       d   \        4       # VR ,          # rU  )r:  r   )r   r   r,   r   deps_from_containerr    s    |||uw<r   upz9Create and start the entire stack or some of its servicesc               r.   r  r   r   r   r   r   r     s'     ~ ~m ~3E ~* ~r   c                s  a aaa"   \        S S4      p\        P                  R 4       SP                  '       g   \        P
                  ! R.RSP                  '       * /SP                  B pS P                  R,          ! S V4      G Rj  xL
 pV^ 8w  d*   \        P                  R4       SP                  '       g   V# \        P                  ! S P                  P                  . RRRS P                   2RR	R
.4      G Rj  xL
 4       Uu/ uF*  pVR,          ^ ,          VR,          P!                  R4      bK,  	  pp\#        V4      ^ 8  Ed&   SP$                  '       d*   SP&                  '       d   \        P                  R4       ^# SP$                  '       d   RpMSSP&                  '       d   RpM>\#        VP)                  4        Uu. uF  qS P*                  8w  g   K  VNK  	  up4      ^ 8  pV'       d{   \        P                  R4       \        P
                  ! R./ \-        SP                  RRR7      B p	S P                  R,          ! S V	4      G Rj  xL
  / p\        P                  R4       \/        S 4      G Rj  xL
  \        P                  R4       . p
S P0                   F  pVR,          V9   g   VR,          V9   d    \        P3                  RVR,          4       K>  \5        S VRSP6                  R7      G Rj  xL
 pS P                  P9                  . RV4      G Rj  xL
 pV
P;                  V4       K  	  SP                  '       d   R# SP<                  '       d   \?        R V
 4       ^ 4      # SP@                  '       d   \        P                  R4       . pS P0                   Fs  pVR,          V9   d    \        P3                  RVR,          4       K0  \C        S VR,          \E        SV4      . RVR,          .34      G Rj  xL
 pVP;                  V4       Ku  	  \?        R V 4       ^ 4      # \        P                  R 4       SP                  P!                  R!4      pV'       d   RSn#        ^ pS P0                   F   p\#        VR,          4      pVV8  d   TMTpK"  	  \I        4       oR" VV V3R# llo\J        PL                  R$8w  d:   \N        PP                  ! 4       pVPS                  \T        PV                  V3R% l4       \Y        S P0                  4       F  w  ppV\#        S PZ                  4      ,          pS PZ                  V,          pR&V\#        VR,          4      ,
          ^,           ,          pR'P]                  VVR,          V4      pVR,          V9   d    \        P3                  R(VR,          4       K  SP_                  \N        P`                  ! \C        S VR,          \E        SV4      . RRVR,          .3VR)7      VR,          R*7      4       K  	  R+ R, lp^ pRpRpS'       Ed$   \N        Pb                  ! S\N        Pd                  R-7      G Rj  xL
 w  poSPf                  '       d'   Vf#   V F  pVPi                  4       ^ 8w  g   K  TpK  	  SPF                  '       g   V'       g   K  V'       gH   \N        Pj                  ! ^4      G Rj  xL
  S F#  pV! V4      '       d   K  VPm                  4        K%  	  RpV'       d   VPi                  4       pK  V F*  pVPo                  4       V8X  g   K  VPi                  4       pK,  	  EK,  V#  EL EL`u upi u upi  EL EL ELp ELN ELl EL L5i)/zbuilding images: ...r  r9   NzBuild command failedpsr  r  -ar  rf  ZNamesZLabelszio.podman.compose.config-hashzYCannot use --force-recreate and --no-recreate at the same time, please remove one of themTFz%tearing down existing containers: ...rC  rmidownz(tearing down existing containers: done

z creating missing containers: ...r   ra   z** skipping create: %s)r9  r:  r   c              3  B   "   T F  qf   K  V^ 8w  g   K  Vx  K  	  R # 5ir    r   r  ZcoderE   r   r  compose_up.<locals>.<genexpr>j  s     [&8dTQUYZQZTT&8   
z#starting containers (detached): ...z** skipping start: %sr;   c              3  r  r    r   r  rE   r   r  r  y  s     Z&7dTPTXYPYTT&7r  z#starting containers (attached): ...exit_code_fromc               r  r*  r   r   r   r   r    compose_up.<locals>.__annotate__  s     
 
 
r   c            
     s  <"   \         P                  R 4        \         P                  R4       \        P                  ! R/ \	        SP
                  RRR7      B p SP                  R,          ! SV 4      G Rj  xL
  S F  pVP                  4        K  	  R#  L  \         d!   p\         P                  RT4        Rp?LCRp?ii ; i  S F  pTP                  4        K  	  i ; i5i)z)Caught SIGINT or Ctrl+C, shutting down...z(Shutting down gracefully, please wait...FNr  r  zError during shutdown: %sr   )
r   r  r.  r/  r   r7  r-  	Exceptionr  cancel)	down_argsr   taskr   rm   r  s      r   handle_sigintZ!compose_up.<locals>.handle_sigint  s     <=	HH?@ **ZT$--TX-YZI""6*7I>>>  	 ? 	6II1155	6  sM   C&AB 8B9B =C&B C%C ;C  CC C##C&Zwin32c                 s:   < \         P                  ! S ! 4       4      # r    )r  r  )r  r  r   r"   Zcompose_up.<locals>.<lambda>  s    w7J7J=?7[r   r  z{}[{}]{}|[0mz** skipping: %s)r  r  c               r
   )r   r  r   r   r   r   r   r   r   r   r    s      d t r   c                s    V P                  4       '       d   R # \        P                  R8  d   V P                  4       '       d   R # R# )TF)i   i   )Z	cancelledr.  Zversion_infoZ
cancelling)r  r   r   _task_cancelledZ#compose_up.<locals>._task_cancelled  s2    >>w&4??+<+<r   )Zreturn_whenr   )8r  r   r  no_buildr.  r/  r9   r7  r-  r  r  rf  loadsr   r   ru   rw   r]   force_recreateno_recreater8  r3  r   r  r1  r   rn  r:  r:   rf   no_startrZ  detachr  r  Zabort_on_container_exitr   r.  rZ  r  Zget_event_loopZadd_signal_handlersignalZSIGINTr  r4  r   r  r  r  ZFIRST_COMPLETEDZabort_on_container_failureZresultr  r  Zget_name) rm   r   r  r  Zbuild_exit_coderj  Zexisting_containersZteardown_neededZhr  Zcreate_error_codesr   r   r  Zstart_error_codesr  Zmax_service_lengthZcurr_lengthZloopr!   Z	color_idxZcolorZspace_suffixr  r  ZexitingZfirst_failed_taskr  r  Zt_r  r  s    ff                            @@r   
compose_upr    sM    GT*HHH#$===''X4::~X$--X
 ' 0 0 9': NNaII,-<<<&& ..''6w7K7K6LM
 

2
A 	
'
1q{'FGG
  2" !#4#3#3#3II, "O#O  3 : : <W <1WEVEV@VQQ <WX[\\  HH<= **ZT$--TX-YZI""6*7I>>>"$HHAB
g
HH/0+-!!z?h&#f+9L*LII.F<-gsUTXT`T`aa!..,,R;GG	!!), " |||}}}[&8[]^__{{{67.0%%C:(*		13v;?+V&9$&Dr7UXY_U`TaFb I $$Y/ & Z&7Z\]^^HH23
 ]]&&'78N'+$!!#j/*,7:L,L[Rd "  #uE
 
 ||w%%'/[\G../3G2233	&&y103s:3GG!KL*11%Z,Wz?h&II'V5		K'c24V"56"/ _		
 0. IG
%#LLG<S<STTe***/@/H 88:?()%  '''+<+< mmA&&&A*1--
  G  .446	B{{}6$&IIK	  m O
2@ X ?  bG"X U 's8  B^ ]	1^ ;A^ ?] 
^ 
0]":$^ ^ 1(^ ^ /^ 	]' ]'&^ 8A^ ],)^  ]/B^ ]2$^ ']5(*^ ^ '$^ B ^ ]8A#^ 1G^ 7)^  ];!^ :^ ^ 2^ <^ ^ ]>^ 7^ )^ ^ ^ "^ /^ 2^ 5^ 8^ ;^ >^ c               r.   )r   rm   rn   r   r   r   r   r   r   r   r   r   r     s!      m $ 9 r   c                sH   V P                   pVR ,          p. pVP                  R. 4       Ft  p\        V\        4      '       d   \	        WR4      p\        WV4      pVR,          pVR8w  d   KB  VP                  R/ 4      P                  R4      pVP                  V4       Kv  	  V# )r   rC  rY   rS   rq   ra   )r   rw   r   r   rk   r   rf   )rm   r   rN   rp   r  rS   rh   volume_namerF  r   get_volume_namesr    s    ooG:H	B'')R(fc""&v7F:F^
!jj,008
		+ ) Ir   r  ztear down entire stackc               r.   r  r   r   r   r   r   r     s,     QA QA QA5G QAD QAr   c                s	  "   \        W4      p. p\        VR R4      p\        \        V P                  4      4      p. pV F  pVR,          V9   d   K  . VOpTp	V	f"   VP                  R\        4      p
\        V
4      p	V	e   VP                  R\        V	4      .4       VP                  \        P                  ! V P                  P                  . R. VOVR,          N4      VR,          R7      4       K  	  \        P                  ! V!  G Rj  xL
  V F@  pVR,          V9   d   K  V P                  P                  . RVR,          .4      G Rj  xL
  KB  	  \!        4       pVP"                  '       Ed    V P                  P%                  . R	R
RV P&                   2RRR.4      G Rj  xL
 P)                  R4      P+                  4       pV Uu0 uF  qP-                  4       ^ ,          kK  	  ppV Uu0 uF  qP-                  4       ^,          kK  	  ppV F,  pV P                  P                  . R. VOVN4      G Rj  xL
  K.  	  V F)  pV P                  P                  . RV.4      G Rj  xL
  K+  	  VP.                  '       d   \!        4       pV F-  pVR,          V9  d   K  VP1                  \3        W4      4       K/  	  \4        P7                  RV4       V P                  P9                  4       G Rj  xL
  F3  pVV9   d   K  V P                  P                  . RRV.4      G Rj  xL
  K5  	  VP:                  '       d   \!        4       pV FO  pVR,          V9   d   K  VP:                  R8X  d   \=        V4      '       g   K7  VP?                  VR,          4       KQ  	  VP1                  V4       \4        P7                  RV4       V P                  P                  . RRR.\        V4      ,           4      G Rj  xL
  V'       d   R# V P@                   F1  pV P                  P                  . RRVR,          .4      G Rj  xL
  K3  	  V P                  PC                  4       G Rj  xL
  F*  pV P                  P                  . RRV.4      G Rj  xL
  K,  	  R#  EL ELR ELu upi u upi  ELu ELI EL EL L L{ LW L/5i)r_  Nr   stop_grace_periodr  r<   ra   r  rmr  r  r  r  r  z{{ .Image }} {{ .Names }}rr   zkeep %srS   localra  zimages to remove: %sr  z--ignorez--forcer=  r   )"r  r_  r#   r  r1  rw   STOP_GRACE_PERIODrC   r   r   rf   r  r  r   r:   r  r   remove_orphansr   ru   r   r  r\   rC  r   r  r   r   r  r  r  r  ra  r  )rm   r   r  r   timeout_globalr1  Z
down_tasksr   Zpodman_stop_argsr_  timeout_strZorphaned_imagesZorphaned_containersr   namesra   Zvol_names_to_keepr  Zimages_to_remover=  r   s   &&                   r   compose_downr    s1    G*HKT9d3Nhw1123JJz?h&)[> ?''"57HIK$[1G##T3w<$89""2v/O1A/O3v;/OPWZ[aWb	
  ..*
%%%z?h&nn  TCK=999 
 eO nn++":7;O;O:PQ"3
 
 VG_Z\ 	" 8KK7Jt::<??7JK-@A-@Ta-@AD..$$R1E;1E1EFFF D..$$Rv666 |||EC:h.$$%5g%CD  			)./!(!9!9!;;;K//..$$RD+3FGGG < xxx5C:(*xx7"8C==  W.  	0		(*:;nn  UZ,CdK[F\,\]]]||nn  UT3v;,?@@@  22444nn  Yw@@@ 5u & 	:
 LAF6 < H 	^
 	A4@s   D
SRASR AS&R#'%SR&+S1R++S;R0<.S*R3+SA0S5R662S(R9)SB8S;R<<S:SR>%S(S ))SSS S#S&S3S6S9S<S>S SSr  zshow status of containersc               r.   r  r   r   r   r   r   r   E  s"      m 3E $ r   c                s&  "   R RRV P                    2.pVP                  RJ d   VP                  RR.4       M/VP                  '       d   VP                  RVP                  .4       V P                  P                  . RV4      G Rj  xL
  R#  L5i)r  r  r  Tr  z{{.ID}}r  N)ru   quietr   r   r   r:   )rm   r   Zps_argsr   r   
compose_psr  D  s     Z#CGDXDXCY!Z[GzzT
I./	
DKK01
..


  s   AB=BB	Bz@create a container similar to a service to run a one-off commandc               r.   r  r   r   r   r   r   r   X  s"     ( (} (4F (4 (r   c                sf  "   \        V 4      G R j  xL
  V P                  VP                  4       V P                  VP                  ,          pV^ ,          p\	        V P
                  V,          4      pVR,          pV'       d   VP                  '       gp   \        P                  ! R/ \	        VP                  RV Uu. uF  qfP                  NK  	  upRR RRRR. ^RR7      B pV P                  R,          ! W4      G R j  xL
  \        P                  ! RRVP                  .RVP                  '       * R. /VP                  B pV P                  R	,          ! W4      G R j  xL
  \        WV4       \        WVP                  VP                  4      G R j  xL
 p	VP                  '       g7   V	P!                  ^R
4       VP"                  '       d   V	P!                  ^R4       V P$                  P'                  . RV	4      G R j  xL
 p
\(        P*                  ! V
4       R #  ELu upi  EL( L L L+5i)Nr>  TF)r  r  r  r9   r  r  r  r  r  rB  r  r  r  r  r  r9   rO  --rmr:   r   )r  r6  r  r,  r   rb  r:  r.  r/  r7  ra   r-  r9   &compose_run_update_container_from_argsrn  r  Zinsertr  r   r:   r.  r/  )rm   r   container_namesrS  r   rh  r  Zup_argsr  r   r  rj   r   compose_runr  S  s     g
DLL)88FO$Q'N
w((8
9Cw<DDLLL$$ 
*./$Q&&$/$!#
" t$W666## ,,48JJKMQUQ^Q^J 

7
#G
888*7>)'T\\RRK;;;1d#777q&)nn  UK88AHHQKO  0 	7
 9 S
 	9sw   H1H BH1'H1=H#/H1 H(A H1!H+"4H1H-H1-#H12H1H/H1#H1+H1-H1/H1c               r   )	r   rm   rn   r   r   r   rf  r   r/   r   r   r   r   r   r     s,     % %%!%%-?%	%r   c                s   V P                  VP                  R \        P                  ! ^ R4       24      pVP                  ;'       g    TVR&   VP
                  '       d   VP
                  VR&   VP                  '       d   VP                  VR&   VP                  '       d   VP                  VR&   \        VP                  R/ 4      4      pVP                  '       d6   \        \        R VP                  4      4      pVP                  V4       WAR&   VP                  '       g   R F  p W K  	  VP                  '       d;   VP                  R. 4      pVP!                  \#        VP                  4      4       WqR&   VP$                  '       d;   \'        VP                  R	. 4      4      pVP!                  VP$                  4       WR	&   VP(                  '       * VR
&   VP*                  e*   \-        VP*                  4      ^ 8  d   VP*                  VR&   VP.                  '       d   RV9   d   VR R# R# R#   \         d     EK  i ; i)Ztmpi   ra   rX  rK  rM  r   c                s(    V P                  R ^R7      # )r   Zmaxsplitr\   Zeachr   r   r"   Z8compose_run_update_container_from_args.<locals>.<lambda>  s    DJJsQJ4Or   rH  rC  rQ  Nrb  rW  )rF  rG  rH  )rx   r  randomZ	randrangera   rX  rK  workdirr   rw   r   r  r   Zservice_portsr   Zpublishr   r  rS   r  Tcnt_commandr]   r  )	rm   r   r   rc  r   additional_env_varsr   rH  rC  s	   &&&      r   r  r    s    F4D4DQ4N3O.PQE))$$uCK OOLyyyiiF|||!\\M
sww}b)
*Cxxx"3'OQUQYQY#Z[

&' M2AF 3
 |||$Z-.G{{{	2./t{{# IVVCJ#D,<,<(=(A))Iwww9#	N $w  s   +H66IIr  z(execute a command in a running containerc               r.   r  r   r   r   r   r   r     s"       5G D r   c                sh  "   V P                  VP                  4       V P                  VP                  ,          pW!P                  ^,
          ,          pV P                  V,          p\        WCV4      pV P                  P                  . RV4      G Rj  xL
 p\        P                  ! V4       R#  L5i)i   r  N)
r6  r  r,  indexrb  compose_exec_argsr   r:   r.  r/  )rm   r   r  rS  r   r   r  r  r   compose_execr    s     DLL)88FO$ZZ!^4N

#
#N
3C#C>Knn  V[99AHHQK 	:s   BB2B0B2c               r   )	r   r   r   rS  r   r   rf  r   r   r   r   r   r   r   r     s*      4  <N S\ r   c                s   R .pVP                   '       d   VR.,          pVP                  '       d   VRVP                  .,          pVP                  '       d   VRVP                  .,          pVP                  '       g   VR.,          p\	        V P                  R/ 4      4      pVP                  '       d2   \	        \        R VP                  4      4      pVP                  V4       VP                  4        F  w  rgTRVf   T MV RV 2.,          pK  	  W1.,          pVP                  e-   \        VP                  4      ^ 8  d   W2P                  ,          pV# )	z--interactiverT  --user	--workdirrR  r   c                s>    R V 9   d   V P                  R ^R7      # V R3# )r   r  Nr  r  r   r   r"   Z#compose_exec_args.<locals>.<lambda>  s$    C4KTZZaZ8YdTX\Yr   --envr   )rS  rK  r  r  r   rw   r   r  r   r   r  r]   )r   rS  r   r   r   r  ra   r   r~   r   r  r    s(   "#K''yyy$)),,|||T\\22666y 
sww}b)
*Cxxx"Y[_[c[cd
 	

&'yy{emD6D65'ARSS ###K#D,<,<(=(A'''r   c               r   )	r   rm   rn   r   rf  rC  r   r   r/   r   r   r   r   r   r     s,     ! !!"4!>A!	!r   c                s$  "   V P                   pVP                  '       g   VP                  4       Vn        V P                  VP                  4       . pVP                   F2  pWS9  d   \	        R V,           4      hVP                  W5,          4       K4  	  VR9   d   \        \        V4      4      p\        VRR4      p. pV F  p. p	VR8w  dY   Tp
V
f3   V P                  V,          P                  R\        4      p\        V4      p
V
e   V	P                  R\        V
4      .4       VP                  \        P                   ! V P"                  P%                  . W)V.,           4      4      4       K  	  \        P&                  ! V!  G Rj  xL
  R#  L5i)zunknown service: r_  Nr;   r  r  )r<   rW  )r,  r  r   r6  r2   r   r#   r  r_  rb  rw   r  rC   r   rf   r  r  r   r:   r  )rm   r   rC  r,  targetsr  r  r  r[   r   r_  r  s   &&&         r   transfer_service_statusr    sU     ")!C!C===2779DMM*G==407:;;1:; ! $$x()T9d3NEW$G%77?CC'): )5"""D#g,#78W((););BW]V^H^)_`a  ..%
   s   FFFFzstart specific servicesc               r.   r  r   r   r   r   r   r     s"     : : :6H :T :r   c                :   "   \        WR 4      G Rj  xL
  R#  L5i)r;   Nr  rm   r   r,   r   compose_startr    s     
!'
999   zstop specific servicesc               r.   r  r   r   r   r   r   r     s"     9 9 95G 9D 9r   c                r  )r<   Nr  r  r,   r   compose_stopr    s     
!'
888r   rW  zrestart specific servicesc               r.   r  r   r   r   r   r   r     s"     < <= <8J <t <r   c                r  )rW  Nr  r  r,   r   compose_restartr    s     
!'
;;;r   logszshow logs from servicesc               r.   r  r   r   r   r   r   r     s"     6 6 65G 6D 6r   c                s   "   V P                   pVP                  '       g(   VP                  '       g   VP                  4       Vn        V P	                  VP                  4       . pVP                   F  pVP                  W$,          4       K  	  . pVP                  '       d   VP                  R 4       VP                  '       d   VP                  R4       VP                  '       d   VP                  R4       VP                  '       d   VP                  RVP                  .4       VP                  '       d/   VP                  R8w  d   VP                  RVP                  .4       VP                  '       d   VP                  R4       VP                  '       d   VP                  RVP                  .4       V F  pVP                  V4       K  	  V P                  P                  . RV4      G R	j  xL
  R	#  L5i)
rq  -l-n--sincer   --tailr  --untilr  N)r,  r  Zlatestr   r6  r   Zfollowrf   r  ZsinceZtailZ
timestampsZuntilr   r:   )rm   r   r,  r  r  r   r[   r  r   compose_logsr	    si    !(!C!C===2779DMM*G==1:; !K{{{4 {{{4 zzz4 zzzItzz23 yyyTYY%'Hdii014 zzzItzz236" 
..

R
555sB   0G>A/G>#"G>"G>)"G>.G>;?G>;"G>AG>5G<6G>r  zdisplays the compose filec               r.   r  r   r   r   r   r   r     s"     # #- #7I #d #r   c                s   "   VP                   '       d5   V P                    F"  pVP                  '       d   K  \        V4       K$  	  R # VP                  '       g   \        V P                  4       R # R # 5ir    )r  r  r  r`  )rm   r   r  r   r   compose_configr
    sO     }}}''G:::g ( 	:::g!!" s   1A4"A4A4r  z*Prints the public port for a port binding.c               r.   r  r   r   r   r   r   r   (  s"       5G D r   c                s  "   V P                  VP                  4       V P                  VP                  ,          pV P                  P	                  . R W!P
                  ^,
          ,          .4      G Rj  xL
 p\        P                  ! VP                  R4      4      p\        VP                  4      R,           VP                  ,           pV^ ,          R,          R,          V,          ^ ,          R,          p\        V4       R#  L5i)r   Nrr   rQ   ZNetworkSettingsZPortsZHostPort)r6  r  r,  r   r   r  rf  r  r   r   private_portr  r  )rm   r   r1  r   Zinspect_jsonr  Z	host_portr  r   compose_portr  '  s     DLL)33DLLAJ>>((YJJQRN9S8TUUF::fmmG45Lt(()C/$--?LQ 127;LI!LZXI	)	 Vs   A1D3D4BDpausezPause all running containersc               r.   r  r   r   r   r   r   r   3  s"     3 3 36H 3T 3r   c                  "   V P                   pVP                  '       g   VP                  4       Vn        . pVP                   F  pVP                  W$,          4       K  	  V P                  P                  . R V4      G Rj  xL
  R#  L5i)r  Nr,  r  r   r   r   r:   rm   r   r,  r  r  r   r   compose_pauser  2  si     !(!C!C===2779G==1:; !
..

R'
222   B BB	BunpausezUnpause all running containersc               r.   r  r   r   r   r   r   r   >  s"     5 5= 58J 5t 5r   c                r  )r  Nr  r  r   r   compose_unpauser  =  si     !(!C!C===2779G==1:; !
..

RG
444r  r  z:Kill one or more running containers with a specific signalc               r.   r  r   r   r   r   r   r   I  s"     : : :5G :D :r   c                s0  "   VP                   '       g=   VP                  '       g+   \        P                  R 4       \        P
                  ! 4        V P                  p. pVP                  '       d   VP                  RVP                  .4       VP                  RJ dt   VP                  4       p. pV F  pVP                  W&,          4       K  	  V F  pVP                  V4       K  	  V P                  P                  . RV4      G Rj  xL
  R# VP                   '       dn   . pVP                    F  pVP                  W&,          4       K  	  V F  pVP                  V4       K  	  V P                  P                  . RV4      G Rj  xL
  R# R#  L L
5i)zUError: you must provide at least one service name or use (--all) to kill all services--signalTr  N)r  r   r   r-  r.  r/  r,  r  r   r   rf   r   r:   )rm   r   r,  r   r  r  r  r[   rF  r   compose_killr  H  s?     ===		c	
 	
!(!C!CK{{{J45xx4-224GNN5>?  Fv& nn  V[999	}}GNN5>? %Fv& nn  V[999 
 	: 	:s7   $FA	F1BF
FF#A&F	F
	FFstatszPDisplay percentage of CPU, memory, network I/O, block I/O and PIDs for services.c               r.   r  r   r   r   r   r   r   m  s"       6H T r   c                s  "   V P                   pVP                  '       g   VP                  4       Vn        . p. pVP                  '       d   VP	                  R VP                  .4       VP
                  '       d   VP	                  RVP
                  .4       VP                  '       d   VP                  R4       VP                  '       d   VP                  R4       VP                   F  pVP	                  W%,          4       K  	  V F  pVP                  V4       K  	   V P                  P                  . RV4      G Rj  xL
  R#  L  \         d     R# i ; i5i)
--intervalr  
--no-reset--no-streamr  N)r,  r  r   r^  r   r   Zno_resetrf   Z	no_streamr   r:   ZKeyboardInterrupt)rm   r   r,  r  r   r  r[   r  r   compose_statsr  h  s     ")!C!C===2779GK}}}L$--89{{{J45}}}<(~~~=)==1:; !6" nn  Wk::: sU   A	E.E;.E*"EAE# E E
E E
E EEEEr  z*List images used by the created containersc               r.   r  r   r   r   r   r   r     s"      (  (-  (7I  (d  (r   c           
     s  "   V P                    Uu. uF  pR V9   g   K  VNK  	  pp. pVP                  RJ dp   V Fh  pVR,          pV P                  P                  . RRVR ,          .4      G Rj  xL
 pVP	                  VP                  R4      P                  4       4       Kj  	  MVP	                  . RO4       V Fx  pVR,          pV P                  P                  . RRR	V,           R
,           RVR ,          .4      G Rj  xL
 pVP	                  VP                  R4      P                  4       4       Kz  	  \        V!   Uu. uF  p\        \        \        V4      4      NK  	  p	pV Fp  p
\        W4       UUu. uF  w  rVP                  V4      NK  	  pppRP                  VRR 4      P                  4       .VRR% \        RP                  V4      4       Kr  	  R# u upi  ELu Lu upi u uppi 5i)ra  Tra   r  --quietNrr   rJ   r  ztable z+ {{.Repository}} {{.Tag}} {{.ID}} {{.Size}}r  Z	)Z	CONTAINERZ
REPOSITORYZTAGzIMAGE IDZSIZErJ   i)r1  r  r   r   rf   r   r\   rX  Zmaxr  r]   Zljustrc   r@   r  )rm   r   r   r  r  Zimgra   r   ZcolumnZcolumn_widthsZrowZcellZwidthZformatted_rowr  r   compose_imagesr    s    %,%7%7J%7c7c>cc%7NJDzzT!Cv;D">>00X	3w<?XYYFKKg.4467 "
 	NO!Cv;D">>00tO&SSL		 	F KKg.4467 " :=dDvSS&)*MD >A#>UV>U{tE*>UV ggmBC&89??ABbcdii&'	 7 K
 Z	 E
 WsT   G5	G G AG50G%1BG5G(AG5"G*&G5;G/AG5(G5*G5c               r
   rl  r   r   r   r   r   r     s      "9 d r   c                s^    V P                  R RRR.RRR7       V P                  RRRR	7       R
# )rq  r  r  rf  zFormat the outputchoicesr   rg  z--shortrn  z*Shows only Podman Compose's version numberrC  rg  Nrs  rj  r   r   compose_version_parser#    sG    
6"    9  r   c               r
   rl  r   r   r   r   r   r     s     Z Z4 Z Zr   c                s   V P                  R RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  R	RR
R7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RRRR7       V P                  RR\        RRR7       V P                  R R!RR"R7       V P                  R#RR$R7       V P                  R%R&R'R(7       V P                  R)R*\        RR+R,7       R# )-r<  --detachrn  zDetached mode: Run container in the background, print new container name.             Incompatible with --abort-on-container-exit and --abort-on-container-failure.r   z
--no-colorzProduce monochrome output.z--quiet-pullz+Pull without printing progress information.	--no-depszDon't start linked services.z--force-recreatezJRecreate containers even if their configuration and image haven't changed.z--always-recreate-depsz?Recreate dependent containers. Incompatible with --no-recreate.z--no-recreatez\If containers already exist, don't recreate them. Incompatible with --force-recreate and -V.z
--no-buildz+Don't build an image, even if it's missing.z
--no-startz-Don't start the services after creating them.--build(Build images before starting containers.z--abort-on-container-exitziStops all containers if any container was stopped. Incompatible with -d and --abort-on-container-failure.z--abort-on-container-failurezzStops all containers if any container stops with a non-zero exit code. Incompatible with -d and --abort-on-container-exit.r  	--timeoutNzvUse this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)rY   r   rg  z-Vz--renew-anon-volumeszSRecreate anonymous volumes instead of retrieving data from the previous containers.--remove-orphans?Remove containers for services not defined in the Compose file.z--scalezSERVICE=NUMz]Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.)rp  rg  z--exit-code-fromZSERVICEzZReturn the exit code of the selected service container. Implies --abort-on-container-exit.)rp  rY   r   rg  )rs  r)   r   r"  r   r   compose_up_parser,    s   
[	   \@\]
:  
 L?]^
Y  
  N  
    :  
 <  
 ,-W   #(   &1   -   b	   N   H   -  r   c               r
   rl  r   r   r   r   r   r     s      6 4 r   c           	     s    V P                  R RRRRR7       V P                  RRRR7       V P                  R	\        R
RRR.RR7       R# )r   z	--volumesrn  FzxRemove named volumes declared in the `volumes` section of the Compose file and anonymous volumes attached to containers.rC  r   rg  r*  r+  r   z--rmiZ?r   r  zkRemove images used by services. `local` remove only images that don't have a custom tag. (`local` or `all`))rY   nargsZconstr  rg  Nrs  r   r"  r   r   compose_down_parser0    sr    
4   N  
 % )  r   c               r
   rl  r   r   r   r   r   r   9  s     K K5 K$ Kr   c                s   V P                  R RRR7       V P                  RRRRR7       V P                  R\        RR	R
7       V P                  R\        RRR
7       V P                  RRRRRR7       V P                  RRRRRR7       V P                  RR\        RRR
7       V P                  RRRR7       V P                  RRRR7       V P                  RRRRR7       V P                  R RR!R7       V P                  R"R#RR$R7       V P                  R%RR&R7       V P                  R'R(\        RR)R
7       V P                  R*R*RR+R,7       V P                  R-R.\        P                  R/R,7       R# )0r&  rn  r'  r   r<  r$  IDetached mode: Run container in the background, print new container name.z--nameNzAssign a name to the containerr)  rY  z%Override the entrypoint of the image.rB  r  KEY=VALrf   8Set an environment variable (can be used multiple times)rp  rC  rg  r  r   z4Add or override a label (can be used multiple times)rL  r   Run as specified username or uidr%  zDon't start linked servicesr  z5Remove container after run. Ignored in detached mode.rI  z	--publishzFPublish a container's port(s) to the host (can be used multiple times)z--service-portszDRun command with the service's ports enabled and mapped to the host.r   r   z0Bind mount a volume (can be used multiple times)-TODisable pseudo-tty allocation. By default `podman-compose run` allocates a TTY.rN  r  &Working directory inside the containerr  service namerp  r.  rg  r  rb  command and its arguments)rs  r   r.  	REMAINDERr"  r   r   compose_run_parser=  8  s   
,-W   X	   sD?_`
4	   G   C   hS$5W   L?\]
D  
 U	   S  
 ?	   ^  
 5   	9D~V
  (	  r   c               r
   rl  r   r   r   r   r   r     s     / /6 /4 /r   c                s   V P                  R RRRR7       V P                  RRRRR7       V P                  R	R
\        RRR7       V P                  RRRR7       V P                  R\        ^RR7       V P                  RRRRRR7       V P                  RR\        RRR7       V P                  RRRRR7       V P                  RR\        P                  R R7       R# )!r<  r$  rn  r1  r   rT  FzAGive the process extended Linux capabilities inside the containerr-  rL  r  Nr5  r)  r6  r7  --indexzCIndex of the container if there are multiple instances of a servicerB  r  r2  rf   r3  r4  rN  r  r8  r  r9  r:  r  rb  r;  )rs  r   r)   r.  r<  r"  r   r   compose_exec_parser?    s(   
X	   P	   hS$5W   ^  
 R	   G   5   	9D~V
  (	  r   c               r
   rl  r   r   r   r   r   r           "9 d r   c                s:    V P                  R RR\        RR7       R# )r  r(  z'Specify a shutdown timeout in seconds. Nrr  rs  r)   r"  r   r   compose_parse_timeoutrB    s$    
6  r   c               r
   rl  r   r   r   r   r   r     s      6 4 r   c                sp   V P                  R RRRR7       V P                  RRRRR7       V P                  RR	RR
R7       V P                  RR\        RR7       V P                  RRRRR7       V P                  RR\        RR7       V P                  RR\        RR7       V P                  RRRRRR7       R# )rq  z--followrn  z'Follow log output. The default is falser   r  z--latestz.Act on the latest container podman is aware ofr  z--namesz$Output the container name in the logr  zShow logs since TIMESTAMPNrr  r  z--timestampszShow timestamps.r  zDNumber of lines to show from the end of the logs for each container.r   r  zShow logs until TIMESTAMPr  *service namesrp  r.  r   rg  r/  r"  r   r   compose_logs_parserF    s    
6	   =	   3	   	(C#W[\
n\HZ[
S	   	(C#W[\
Jc4o  r   c               r
   rl  r   r   r   r   r   r     r@  r   c                s6    V P                  R R. RORRR7       R# )r  z--actionr  z8create systemd unit file or register compose stack to itr  N)r  r  r=  r#   r  r!  r"  r   r   compose_systemd_parserG    s$    
GG  r   c               r
   rl  r   r   r   r   r   r     s     \ \6 \4 \r   c                sZ    V P                  R RRRR7       V P                  RRRRR7       R	# )
z--force-localrn  FzCAlso pull unprefixed images for services which have a build sectionr-  r  rC  zservices to pullr:  Nr!  r"  r   r   compose_pull_parserH    s;    
R	   
JcHZ[r   c               r
   rl  r   r   r   r   r   r     s     \ \6 \4 \r   c                sX    V P                  R RRR7       V P                  RRRRR7       R# )	z--ignore-push-failuresrn  zIPush what it can and ignores images with push failures. (not implemented)r   r  rC  zservices to pushr:  Nr!  r"  r   r   compose_push_parserI    s8    
 X  
 
JcHZ[r   c               r
   rl  r   r   r   r   r   r     s     a a4 a ar   c                0    V P                  R RRRR7       R# )-qr  zOnly display container IDsrn  ro  Nr!  r"  r   r   compose_ps_parserL    s    
i.JS_`r   c               r
   rl  r   r   r   r   r   r     s      #: t r   c                s    V P                  R RRR7       V P                  RRRR7       V P                  RRR. R	R
7       V P                  RRRR7       R# )rV  z,attempt to pull a newer version of the imagern  ro  r  zbattempt to pull a newer version of the image, Raise an error even if the image is present locally.r  zkey=valrf   z&Set build-time variables for services.)rp  rC  r   rg  r  z)Do not use cache when building the image.Nr!  r"  r   r   compose_build_up_parserM    s    
;  
 	   5   8  r   c               r
   rl  r   r   r   r   r   r   (  s       7 D r   c                2    V P                  R R RRRR7       R# )r  rC  Nzaffected servicesrE  r!  r"  r   r   compose_build_parserO  '  s$    
   r   c               r
   rl  r   r   r   r   r   r   3  s      !8 T r   c                s    V P                  R RRR7       V P                  RRRR7       V P                  RRRRR7       R	# )
z--no-normalizezDon't normalize compose model.rn  ro  z
--servicesz&Print the service names, one per line.rK  r  z Do not print config, only parse.Nr!  r"  r   r   compose_config_parserP  2  s[    
?   CL   /	  r   c               r
   rl  r   r   r   r   r   r   C  s      6 4 r   c                s    V P                  R \        ^RR7       V P                  RRR.RRR7       V P                  RRR	R
R7       V P                  RRR	\        RR7       R	# )r>  zCindex of the container if there are multiple instances of a servicer)  z
--protocolr  Zudpz
tcp or udpr  r  Nr9  r:  r  zprivate port)rp  r.  rY   rg  rA  r"  r   r   compose_port_parserQ  B  s    
R	   	   	9D~V
  r   c               r
   rl  r   r   r   r   r   r   [  s      (? D r   c                rN  )r  rC  NrD  rE  r!  r"  r   r   compose_pause_unpause_parserR  Z  s     
Jc4o  r   c               r
   rl  r   r   r   r   r   r   b  s      6 4 r   c                s    V P                  R R RRRR7       V P                  RR\        RR7       V P                  R	R
RRR7       R# )r  rC  NrD  rE  z-sr  z0Signal to send to the container (default 'KILL')rY   rg  r  z--allzSignal all running containersrn  ro  r/  r"  r   r   compose_kill_parserT  a  sb    
Jc4o   ?	   ,	  r   c               r
   rl  r   r   r   r   r   r   u  s     ^ ^!8 ^T ^r   c                rJ  )rK  r  zOnly display images IDsrn  ro  Nr!  r"  r   r   compose_images_parserU  t  s    
i.GP\]r   c               r
   rl  r   r   r   r   r   r   z  s       7 D r   c                s    V P                  R R RRRR7       V P                  RR\        RR7       V P                  R	R
RR7       V P                  RRRR7       R# )r  rC  NrD  rE  rO  r  z1Time in seconds between stats reports (default 5)rS  r  z.Disable resetting the screen between intervalsrn  ro  r  z6Disable streaming stats and only pull the first resultrA  r"  r   r   compose_stats_parserV  y  s}    
Jc4o   @	   =  
 E  r   c               r
   rl  r   r   r   r   r   r     s      !8 T r   c                s8    V P                  R R\        RR7       R# )rq  r  z@Pretty-print container statistics to JSON or using a Go templaterS  Nr/  r"  r   r   compose_format_parserW    s!    
O	  r   c               r  r*  r   r   r   r   r   r     s      $ r   c                 sJ   "   \         P                  4       G R j  xL
  R #  L5ir    )podman_composer:   r   r   r   
async_mainrY    s     



s   #!#c               r  r*  r   r   r   r   r   r     s      d r   c                 sB    \         P                  ! \        4       4       R # r    )r  r:   rY  r   r   r   mainrZ    s    KK
r   Z__main__r    )	r7   r8   r9   r   r:   r;   r<   r  rS   r  )TFrI   )zcompose.yamlzcompose.ymlzcompose.override.yamlzcompose.override.ymlzpodman-compose.yamlzpodman-compose.ymlzdocker-compose.ymlzdocker-compose.yamlzdocker-compose.override.ymlzdocker-compose.override.yamlzcontainer-compose.ymlzcontainer-compose.yamlzcontainer-compose.override.ymlzcontainer-compose.override.yaml)r  r<   rW  )r9   r  r  r;   r<   rW  )Z
__future__r   r.  Zasyncio.exceptionsr  Zasyncio.subprocessr  r  ry   rf  rD  r`   r  r  re  r  r   r.  r  Zurllib.parser  r   Zenumr   Ztypingr   r   r   r   r   r  Zdotenvr	   r?  rb   r   r9  r  r   r%   r-   r6   Z	getLoggerrw  r   Zcompiler_   re   r\  rD   rt  r>   r  rC   rF   rL   rk   r   ZVERBOSEr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r$  r4  r6  r5  rn  ro  r~  r  r  Z
YAMLObjectr  r  r  r  r  r  r
  r  r  r  r  r  r  rc  rW  rn   rX  r  ru  rv  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r
  r  r  r  r  r  r  r#  r,  r0  r=  r?  rB  rF  rG  rH  rI  rL  rM  rO  rP  rQ  rR  rT  rU  rV  rW  rY  rZ  r   r   r   <module>r[     sy   #         	  	    
            			#((1+	&
( 
 4 
 4	 < 
 <   ! 
J	[ **]
#zz,'
 
zz;< ""<5|#d 
 JJ
$ 
 A 
 A	 ? 
 ?	 I 
 I!H"*
$"0_f"9J4 ?E%P58y yx0
0;f9Dx"(5pM<-`4Vrx xvc cB 0 0#! #!VA$// A:9t 9$$,t tnF FR
PCL%D& $g	
 g	
T 	 	 2 & 	N3	4 4	4	 	!BC. D. 	#eC $eCP 	!45
Y 6
Y 	!45 6<c cL. 	"67 8.
9$
1'hK K 	Z[~ \~B  	!9:QA ;QAh 	:; < 		F
(
(V%P 	!KL M0!@ 	";<: =: 	!9:9 ;9 	$?@< A< 	!:;6 <6< 	#>?# @# 	!MN O 	"@A3 B3 	$DE5 F5 	!]^: _:> 	V

4 	#OP ( Q (P >9% & >4 Z !Zz >6" #2 >5!K "K\ >6"/ #/d >67 8 >F8$ %B >9% & >6"\ #\ >6"\ #\ >4 a !a >GT?+ ,4 >NO P >8$ % >6" #. >GY/0 1 >F8$ %$ >8$^ %^ >G9% &, >D'?+ , zF r   