zabetak commented on code in PR #6825:
URL: https://github.com/apache/hive/pull/6825#discussion_r4192876996


##########
standalone-metastore/metastore-server/docker/hive-postgres-tpcds-metastore/Dockerfile:
##########
@@ -14,9 +14,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-FROM postgres:12.3
+FROM postgres:18-alpine
+
+ADD 
https://github.com/thomasrebele/hive-postgres-metastore/releases/download/tpcds-30tb-histogram-1.0/metastore_tpcds30tb_with_histograms.raw_db.zstd
 /tmp/metastore_db.zstd

Review Comment:
   I am using docker not podman. In my tests, **Option 1** reduces the size of 
the image by 500MB and **Option 2** keeps it roughly the same with the PR 
(i.e., 1.53GB) but without the need for custom entry point and lazy unzip.
   
   Yes, in my experiments Option 2 contains the metastore dump as expected. For 
reference the commands below:
   ```bash
   $ docker version
   Client: Docker Engine - Community
    Version:           29.8.2
    API version:       1.56
    Go version:        go1.26.8
    Git commit:        7fc2dff
    Built:             Wed Sep 30 19:32:31 2026
    OS/Arch:           linux/amd64
    Context:           default
   
   Server: Docker Engine - Community
    Engine:
     Version:          29.8.2
     API version:      1.56 (minimum version 1.40)
     Go version:       go1.26.8
     Git commit:       8af9fe3
     Built:            Wed Sep 30 19:32:31 2026
     OS/Arch:          linux/amd64
     Experimental:     false
    containerd:
     Version:          v2.3.6
     GitCommit:        ee2735368117d2eb259779949d5e75cdafec9761
    runc:
     Version:          1.5.1
     GitCommit:        v1.5.1-0-g8f2685a4
    docker-init:
     Version:          0.19.0
     GitCommit:        de40ad0
   
   $ cat Dockerfile 
   FROM postgres:18-alpine
   RUN wget -O /tmp/metastore_db.zstd 
https://github.com/thomasrebele/hive-postgres-metastore/releases/download/tpcds-30tb-histogram-1.0/metastore_tpcds30tb_with_histograms.raw_db.zstd
 \
    && echo '0423efc0cbc554611ac3bbf5e7919b050767bf96  /tmp/metastore_db.zstd' 
> /tmp/metastore_db.sha1 \
    && sha1sum -c /tmp/metastore_db.sha1 \
    && chown postgres:postgres /tmp/metastore_db.zstd \
    && zstdcat /tmp/metastore_db.zstd | tar -C /var/lib/postgresql/ -x \
    && rm /tmp/metastore_db.zstd
   
   $ docker build --tag apache/hive-postgres-tpcds-metastore:1.5-opt2 .
   
   $ docker image ls apache/hive-postgres-tpcds-metastore:1.5-opt2
   IMAGE                                           ID             DISK USAGE   
CONTENT SIZE   EXTRA
   apache/hive-postgres-tpcds-metastore:1.5-opt2   5fb31ff3a96a       1.53GB    
         0B        
   
   $ docker image history apache/hive-postgres-tpcds-metastore:1.5-opt2
   IMAGE          CREATED         CREATED BY                                    
  SIZE      COMMENT
   5fb31ff3a96a   5 minutes ago   RUN /bin/sh -c wget -O /tmp/metastore_db.zst… 
  1.23GB    buildkit.dockerfile.v0
   <missing>      2 weeks ago     CMD ["postgres"]                              
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     EXPOSE map[5432/tcp:{}]                       
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     STOPSIGNAL SIGINT                             
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENTRYPOINT ["docker-entrypoint.sh"]           
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     RUN /bin/sh -c ln -sT docker-ensure-initdb.s… 
  23B       buildkit.dockerfile.v0
   <missing>      2 weeks ago     COPY docker-entrypoint.sh docker-ensure-init… 
  16.9kB    buildkit.dockerfile.v0
   <missing>      2 weeks ago     VOLUME [/var/lib/postgresql]                  
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENV PGDATA=/var/lib/postgresql/18/docker      
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     RUN /bin/sh -c install --verbose --directory… 
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     RUN /bin/sh -c set -eux;  cp -v /usr/local/s… 
  65.3kB    buildkit.dockerfile.v0
   <missing>      2 weeks ago     RUN /bin/sh -c set -eux;   wget -O postgresq… 
  293MB     buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENV DOCKER_PG_LLVM_DEPS=llvm21-dev   clang21  
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENV PG_SHA256=555610c24d53e4316da5b7d3fc25c2… 
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENV PG_VERSION=18.6                           
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENV PG_MAJOR=18                               
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     RUN /bin/sh -c mkdir /docker-entrypoint-init… 
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENV LANG=en_US.utf8                           
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     RUN /bin/sh -c set -eux;   apk add --no-cach… 
  1.97MB    buildkit.dockerfile.v0
   <missing>      2 weeks ago     ENV GOSU_VERSION=1.19                         
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     RUN /bin/sh -c set -eux;  addgroup -g 70 -S … 
  3.06kB    buildkit.dockerfile.v0
   <missing>      2 weeks ago     CMD ["/bin/sh"]                               
  0B        buildkit.dockerfile.v0
   <missing>      2 weeks ago     ADD alpine-minirootfs-3.24.2-x86_64.tar.gz /… 
  8.42MB    buildkit.dockerfile.v0
   
   $ docker run --rm --name tpcds-meta -d 
apache/hive-postgres-tpcds-metastore:1.5-opt2 
   102caa2980395b51b462ba3d517dfbc2224520c0080f8447a34b4d0db60a7f21
   
   $ docker exec tpcds-meta psql -U postgres -d metastore -c \\d+ | grep PART
   
    public | PARTITIONS                    | table    | hive  | permanent   | 
heap          | 1256 kB    | 
    public | PARTITION_EVENTS              | table    | hive  | permanent   | 
heap          | 8192 bytes | 
    public | PARTITION_KEYS                | table    | hive  | permanent   | 
heap          | 16 kB      | 
    public | PARTITION_KEY_VALS            | table    | hive  | permanent   | 
heap          | 640 kB     | 
    public | PARTITION_PARAMS              | table    | hive  | permanent   | 
heap          | 13 MB      | 
    public | PART_COL_PRIVS                | table    | hive  | permanent   | 
heap          | 8192 bytes | 
    public | PART_COL_STATS                | table    | hive  | permanent   | 
heap          | 957 MB     | 
    public | PART_PRIVS                    | table    | hive  | permanent   | 
heap          | 8192 bytes | 
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to