自动go app部署(Automated go app deployment)
我想知道是否有任何方便的方法可以自动将代码部署到GO中的实时服务器,无论是标准内置方法还是其他方法。
我想要谷歌应用程序引擎的东西,我只是运行命令,它上传到服务器并触发重启。
(最终我想要一个git提交来触发重建和重新部署,但这将是未来的轨道)
I'm wondering if there are any convenient ways to automate deployment of code to a live server in GO, either standard built-in methods, or otherwise.
I want something google app engine like, I just run the command and it uploads to the server and triggers a restart.
(Ultimately I want a git commit to trigger a rebuild and redeploy, but thats for down the track in the future)
原文:https://stackoverflow.com/questions/23841193
最满意答案
当我将数据从矢量转换为动态2D数组时,我遇到了同样的问题。 h5write命令的问题不在于它不接受向量,它不理解指针数组的概念。 它只会写出连续的内存。 向量向量在内存中不是连续的,而是指向一堆向量的指针数组。 这就是为什么当你传递数组的第一个元素时第一行是正确的。 表的其余部分只是第一个向量之后的内存中的垃圾。
我的解决方案是创建一个巨大的1D向量并执行我自己的索引来回转换。 这与h5_writedyn.c中的方法类似.https : //www.hdfgroup.org/ftp/HDF5/examples/misc-examples/h5_writedyn.c
I ran into the same problem when i converted my data from a vector to a dynamic 2D array. The problem with the h5write command is not that it will not accept a vector, It does not understand the concept of a pointer array. it only writes out contiguous memory. A vector of vectors is not contiguous in memory but instead a pointer array to a bunch of vectors. That is why when you passed the first element of the array the first row was correct. The rest of the table is just the garbage in memory following the first vector.
My solution was creating a giant 1D vector and performing my own indexing to convert back and forth. This is similar to the approach in h5_writedyn.c https://www.hdfgroup.org/ftp/HDF5/examples/misc-examples/h5_writedyn.c
相关问答
更多-
嗯,我对HDF5一无所知,但是可以通过使用NX * NY大小的一维数组来模拟具有连续缓冲区的C ++中的动态二维数组。 例如: 分配: double *data = new double[NX*NY]; 元素访问: data[j*NY + i] (而不是data[j][i] ) Well, I don't know anything about HDF5, but dynamic 2D arrays in C++ with a contiguous buffer can be simulated by ...
-
两个python程序可以同时写入和读取相同的HDF5文件(can two python programs write and read a same HDF5 file at same time)[2023-09-14]
您正在寻找的是HDF5的Single Writer Multiple Reader(SWMR)功能。 SWMR在1.10版本中被列为新版本,并且有相当多的文档 。 它也是h5py版本2.5.0。 至于大熊猫的支持,我不太确定,因为我不使用它。 What your looking for is the Single Writer Multiple Reader (SWMR) feature of HDF5. SWMR is listed as new in the 1.10 release and has a ... -
问题实际上是用h5py(还有表格)读取h5文件。 当运行h5dump test.h5 ,数据结构和所有向量中的值以及所有事件(我最终写入了每个事件中具有4个可变长度std :: vector的event_struct的向量)正确填充。 我也只使用一个结构并将hvl_t句柄添加到event_struct。 The problem was actually reading the h5 file with h5py (and also with tables). When running h5dump test ...
-
作为一种快速而肮脏的解决方案,可以通过临时将阵列转换为列表来避免循环(如果可以节省内存)。 由于某种原因,记录数组很容易转换为列表或从列表转换而不是转换为传统阵列。 储存: table.append(array.T.tolist()) 加载: loaded_array = np.array(array_table.read().tolist(), dtype=np.float64).T 应该有一个更“Numpythonic”的方法来转换记录数组和传统的数组,但我不熟悉前者知道如何。 As a quick ...
-
关注http://docs.h5py.org/en/latest/special.html 并使用一个打开的h5文件f ,我试过: dt = h5py.special_dtype(vlen=np.dtype('int32')) vset=f.create_dataset('vset', (100,), dtype=dt) 逐个设置元素: vset[0]=np.random.randint(0,100,1000) # set just one element for i in range(100): ...
-
您的p2DArray必须是int的普通(1D)数组,而不是数组数组。 这就是read方法所期望的。 只需分配足够的空间来存储NX * NY号码: int *p2DArray = new int[NX*NY]; 然后使用以下公式访问数组:p2DArray [i] [j] = p2DArray [i * NY + j]。 Your p2DArray must be a plain (1D) array of int, not an array of arrays. That's what a read met ...
-
事实证明,问题是即使你读入一维数组,你仍然将3D数据空间传递给dataset的read方法。 H5File file(file_name, H5F_ACC_RDONLY); DataSet dataset = file.openDataSet(dataset_name); DataSpace dataspace = dataset.getSpace(); hsize_t dim[3]; dataspace.getSimpleExtentDims(dim, NULL); hsize_t memdim = d ...
-
当我将数据从矢量转换为动态2D数组时,我遇到了同样的问题。 h5write命令的问题不在于它不接受向量,它不理解指针数组的概念。 它只会写出连续的内存。 向量向量在内存中不是连续的,而是指向一堆向量的指针数组。 这就是为什么当你传递数组的第一个元素时第一行是正确的。 表的其余部分只是第一个向量之后的内存中的垃圾。 我的解决方案是创建一个巨大的1D向量并执行我自己的索引来回转换。 这与h5_writedyn.c中的方法类似.https : //www.hdfgroup.org/ftp/HDF5/example ...
-
使用HDF5支持文档 假设您的DataSet如下所示:(2D简化说明参数如何工作) 1 2 3 4 5 6 7 8 9 你想要选择6而只选择6 。 这意味着您需要一个位于第二行和第三列的元素。 (一个索引)。 这意味着您将在选择数组中需要1乘2的点数组。 (零索引)。 1 2 如果你也想选择7,那么选择数组将如下所示。 (零索引)。 1 2 2 0 相关的电话将是: H5S.selectElements(dSpace, H5S.SelectOperator.SET, 1, new long [] { ...
-
这真的很有趣,因为我目前正在处理类似的问题。 服务表现 为了更近距离地研究问题,我创建了以下文件 import h5py import numpy as np def one_file(shape=(4000, 4000), n=1000): h5f = h5py.File('data.h5', 'w') for i in xrange(n): dataset = np.random.random(shape) dataset_name = 'datase ...